From 0a20b8321bbf1ebbcdc1390800b13310dc00b29e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 29 Sep 2019 00:09:01 -0600 Subject: [PATCH] Add /api/v1/statuses endpoint --- app/Http/Controllers/Api/ApiV1Controller.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index edc8e5fab..6314cd0de 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -1570,8 +1570,16 @@ class ApiV1Controller extends Controller * * @return null */ - public function statusDelete(Request $request) + public function statusDelete(Request $request, $id) { abort_if(!$request->user(), 403); + + $status = Status::whereProfileId($request->user()->profile->id) + ->findOrFail($id); + + Cache::forget('profile:status_count:'.$status->profile_id); + StatusDelete::dispatch($status); + + return response()->json(['Status successfully deleted.']); } } \ No newline at end of file