mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update BaseApiController
This commit is contained in:
parent
c4483b378f
commit
7869ee9a92
1 changed files with 0 additions and 31 deletions
|
@ -330,35 +330,4 @@ class BaseApiController extends Controller
|
|||
|
||||
return response()->json($res);
|
||||
}
|
||||
|
||||
public function loops(Request $request)
|
||||
{
|
||||
abort_if(!Auth::check(), 403);
|
||||
abort_if(!config('exp.loops'), 403);
|
||||
|
||||
// todo proper pagination, maybe LoopService
|
||||
$loops = Status::whereType('video')
|
||||
->latest()
|
||||
->take(18)
|
||||
->get();
|
||||
|
||||
$resource = new Fractal\Resource\Collection($loops, new StatusTransformer());
|
||||
return $this->fractal->createData($resource)->toArray();
|
||||
}
|
||||
|
||||
|
||||
public function loopWatch(Request $request)
|
||||
{
|
||||
abort_if(!Auth::check(), 403);
|
||||
abort_if(!config('exp.loops'), 403);
|
||||
|
||||
$this->validate($request, [
|
||||
'id' => 'integer|min:1'
|
||||
]);
|
||||
$id = $request->input('id');
|
||||
|
||||
// todo log loops
|
||||
|
||||
return response()->json(200);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue