mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update InternalApiController
This commit is contained in:
parent
e1449b119a
commit
59f8292e07
1 changed files with 15 additions and 0 deletions
|
@ -288,4 +288,19 @@ class InternalApiController extends Controller
|
||||||
|
|
||||||
return;
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue