[API] comments list

This commit is contained in:
xiaomlove
2025-12-30 17:49:56 +07:00
parent 5f37d5c59a
commit 0351f92bf4
5 changed files with 20 additions and 28 deletions

View File

@@ -25,17 +25,8 @@ class CommentController extends Controller
*/
public function index(Request $request)
{
$torrentId = $request->torrent_id;
$with = ['create_user', 'update_user'];
$comments = Comment::query()
->with($with)
->where('torrent', $torrentId)
->paginate();
$comments = $this->repository->getList($request, Auth::user());
$resource = CommentResource::collection($comments);
// $resource->additional([
// 'page_title' => nexus_trans('comment.index.page_title'),
// ]);
return $this->success($resource);
}