Commit fa464bfc authored by Gabriel-31415's avatar Gabriel-31415
Browse files

ajuste

parent 976ba2e4
...@@ -974,6 +974,7 @@ class TrabalhoController extends Controller ...@@ -974,6 +974,7 @@ class TrabalhoController extends Controller
} }
public function salvar(Request $request) { public function salvar(Request $request) {
return response()->json('ok');
$edital = Evento::find($request->editalId); $edital = Evento::find($request->editalId);
$hoje = now(); $hoje = now();
......
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
</div> </div>
</div> </div>
@endif --}} @endif --}}
{{-- action="{{route('trabalho.store')}}" --}}
<p class="card-text"> <p class="card-text">
<form method="POST" name="formTrabalho" action="{{route('trabalho.store')}}" enctype="multipart/form-data"> <form method="POST" name="formTrabalho" enctype="multipart/form-data">
@csrf @csrf
<input type="hidden" name="editalId" value="{{$edital->id}}"> <input type="hidden" name="editalId" value="{{$edital->id}}">
...@@ -590,7 +591,7 @@ ...@@ -590,7 +591,7 @@
</button> </button>
</div> --}} </div> --}}
<div class="col-md-12"> <div class="col-md-12">
<button type="submit" class="btn btn-success" style="width:100%"> <button id="button" type="submit" class="btn btn-success" style="width:100%">
{{ __('Enviar Projeto') }} {{ __('Enviar Projeto') }}
</button> </button>
</div> </div>
...@@ -1168,4 +1169,26 @@ ...@@ -1168,4 +1169,26 @@
} }
</script> </script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
$("#button").click(function(e){
e.preventDefault();
$.ajax({
headers: {
'X-CSRF-Token': $('input[name="_token"]').val()
},
url: "{{route('trabalho.store')}}",
type: 'post',
enctype: 'multipart/form-data',
success: function(result){
console.log("success")
console.log(result)
},
erro: (xhr,status,error) => {
console.log("erro")
}
});
});
</script>
@endsection @endsection
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment