Update ApiV1Controller, fix favourites endpoints

This commit is contained in:
Daniel Supernault 2022-01-09 20:33:43 -07:00
parent 5de6d8accb
commit d6d99385db
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -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);
}