chore: remove events table (#1829)

This commit is contained in:
Régis Freyd
2018-09-22 22:22:34 -04:00
committed by GitHub
parent 1e91959da9
commit b3372264c8
24 changed files with 21 additions and 261 deletions
@@ -42,14 +42,10 @@ class NotesController extends Controller
*/
public function store(NotesRequest $request, Contact $contact)
{
$note = $contact->notes()->create([
return $contact->notes()->create([
'account_id' => auth()->user()->account_id,
'body' => $request->get('body'),
]);
$contact->logEvent('note', $note->id, 'create');
return $note;
}
public function toggle(NoteToggleRequest $request, Contact $contact, Note $note)
@@ -63,8 +59,6 @@ class NotesController extends Controller
$note->favorited_at = now();
}
$contact->logEvent('note', $note->id, 'update');
$note->save();
}
@@ -85,8 +79,6 @@ class NotesController extends Controller
+ ['account_id' => $contact->account_id]
);
$contact->logEvent('note', $note->id, 'update');
return $note;
}
@@ -100,7 +92,5 @@ class NotesController extends Controller
public function destroy(Contact $contact, Note $note)
{
$note->delete();
$contact->events()->forObject($note)->get()->each->delete();
}
}