| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentForm\App\Http\Controllers; |
| 4 |
|
| 5 |
use Exception; |
| 6 |
use FluentForm\App\Services\Submission\SubmissionService; |
| 7 |
|
| 8 |
class SubmissionNoteController extends Controller |
| 9 |
{ |
| 10 |
public function get(SubmissionService $submissionService, $submissionId) |
| 11 |
{ |
| 12 |
try { |
| 13 |
return $this->sendSuccess( |
| 14 |
$submissionService->getNotes($submissionId, $this->request->all()) |
| 15 |
); |
| 16 |
} catch (Exception $exception) { |
| 17 |
return $this->sendError([ |
| 18 |
'message' => $exception->getMessage(), |
| 19 |
]); |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
public function store(SubmissionService $submissionService, $submissionId) |
| 24 |
{ |
| 25 |
try { |
| 26 |
return $this->sendSuccess( |
| 27 |
$submissionService->storeNote($submissionId, $this->request->all()) |
| 28 |
); |
| 29 |
} catch (Exception $exception) { |
| 30 |
return $this->sendError([ |
| 31 |
'message' => $exception->getMessage(), |
| 32 |
]); |
| 33 |
} |
| 34 |
} |
| 35 |
} |
| 36 |
|