diff --git a/app/Http/Controllers/TrabalhoController.php b/app/Http/Controllers/TrabalhoController.php index 3354eff6f0388e185b974053ce39d0024a98822a..e86b8b8e33247dc5eb5105e8d4150547456035b6 100644 --- a/app/Http/Controllers/TrabalhoController.php +++ b/app/Http/Controllers/TrabalhoController.php @@ -847,12 +847,16 @@ class TrabalhoController extends Controller } - - + DB::commit(); + if (!$request->has('rascunho') ) { + Notification::send(Auth::user(), new SubmissaoNotification($id)); + }else{ + } return redirect(route('proponente.projetos'))->with(['mensagem' => 'Proposta atualizada!']); + } catch (\Throwable $th) { DB::rollback(); return redirect(route('proponente.projetos'))->with(['mensagem' => $th->getMessage()]); @@ -952,8 +956,13 @@ class TrabalhoController extends Controller $trabalho->save(); DB::commit(); - - return redirect(route('proponente.projetos'))->with(['mensagem' => 'Proposta submetida!']); + if (!$request->has('rascunho') ) { + Notification::send(Auth::user(), new SubmissaoNotification($trabalho->id)); + return redirect(route('proponente.projetos'))->with(['mensagem' => 'Proposta submetida!']); + }else{ + return redirect(route('proponente.projetos'))->with(['mensagem' => 'Rascunho salvo!']); + + } } catch (\Throwable $th) { DB::rollback(); return redirect(route('proponente.projetos'))->with(['mensagem' => $th->getMessage()]); diff --git a/resources/views/projeto/formularioVisualizar/proponente.blade.php b/resources/views/projeto/formularioVisualizar/proponente.blade.php index 3af78c51b552e3fae23681444941d7c1cffc3c88..b868be318d33a821c1ee38d667cb4b68fd4a5ed3 100644 --- a/resources/views/projeto/formularioVisualizar/proponente.blade.php +++ b/resources/views/projeto/formularioVisualizar/proponente.blade.php @@ -45,7 +45,7 @@
- @error('pontuacaoPlanilha')