From d6d99385db1fa221e3b9b085e122ae67e3759dd9 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 9 Jan 2022 20:33:43 -0700 Subject: [PATCH] Update ApiV1Controller, fix favourites endpoints --- app/Http/Controllers/Api/ApiV1Controller.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index c8cdc7dfd..a4c106fa1 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -1039,8 +1039,8 @@ class ApiV1Controller extends Controller LikePipeline::dispatch($like); } - $resource = new Fractal\Resource\Item($status, new StatusTransformer()); - $res = $this->fractal->createData($resource)->toArray(); + $res = StatusService::getMastodon($status->id, false); + $res['favourited'] = true; return response()->json($res); } @@ -1079,8 +1079,8 @@ class ApiV1Controller extends Controller StatusService::del($status->id); - $resource = new Fractal\Resource\Item($status, new StatusTransformer()); - $res = $this->fractal->createData($resource)->toArray(); + $res = StatusService::getMastodon($status->id, false); + $res['favourited'] = false; return response()->json($res); }