1
0
Fork 0
forked from mirror/pixelfed

Update InternalApiController

This commit is contained in:
Daniel Supernault 2018-12-09 16:02:32 -07:00
parent e1449b119a
commit 59f8292e07
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -288,4 +288,19 @@ class InternalApiController extends Controller
return;
}
public function statusReplies(Request $request, int $id)
{
$parent = Status::findOrFail($id);
$children = Status::whereInReplyToId($parent->id)
->orderBy('created_at', 'desc')
->take(3)
->get();
$resource = new Fractal\Resource\Collection($children, new StatusTransformer());
$res = $this->fractal->createData($resource)->toArray();
return response()->json($res);
}
}