Update ApiController

This commit is contained in:
Daniel Supernault 2019-03-24 21:34:25 -06:00
parent 9bf5662dd9
commit 1de3f0ce24
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -13,23 +13,28 @@ class ApiController extends BaseApiController
// todo: deprecate and remove // todo: deprecate and remove
public function hydrateLikes(Request $request) public function hydrateLikes(Request $request)
{ {
$this->validate($request, [ return response()->json([]);
'min' => 'nullable|integer|min:1', }
'max' => 'nullable|integer',
]);
$profile = Auth::user()->profile; public function siteConfiguration(Request $request)
$res = Cache::remember('api:like-ids:user:'.$profile->id, now()->addDays(1), function () use ($profile) { {
return Like::whereProfileId($profile->id) $res = Cache::remember('api:site:configuration', now()->addMinutes(30), function() {
->orderBy('id', 'desc') return [
->take(1000) 'uploader' => [
->pluck('status_id'); 'max_photo_size' => config('pixelfed.max_photo_size'),
'max_caption_length' => config('pixelfed.max_caption_length'),
'album_limit' => config('pixelfed.max_album_length'),
'image_quality' => config('pixelfed.image_quality'),
'optimize_image' => config('pixelfed.optimize_image'),
'optimize_video' => config('pixelfed.optimize_video'),
'media_types' => config('pixelfed.media_types'),
'enforce_account_limit' => config('pixelfed.enforce_account_limit')
]
];
}); });
return response()->json($res); return response()->json($res);
} }
public function loadMoreComments(Request $request)
{
}
} }