feat: make archived contact readonly (#5285)

This commit is contained in:
Alexis Saettler
2021-06-22 19:01:45 +02:00
committed by GitHub
parent 99bd8e17f8
commit a3fdac949f
70 changed files with 376 additions and 43 deletions
@@ -41,6 +41,8 @@ class NotesController extends Controller
*/
public function store(NotesRequest $request, Contact $contact)
{
$contact->throwInactive();
return $contact->notes()->create([
'account_id' => auth()->user()->account_id,
'body' => $request->input('body'),
@@ -72,6 +74,8 @@ class NotesController extends Controller
*/
public function update(NotesRequest $request, Contact $contact, Note $note): Note
{
$contact->throwInactive();
$note->update(
$request->only([
'body',
@@ -92,6 +96,8 @@ class NotesController extends Controller
*/
public function destroy(Contact $contact, Note $note): void
{
$contact->throwInactive();
$note->delete();
}
}