Refine SEO, uploads, and deploy handling
This commit is contained in:
@@ -30,15 +30,14 @@ final class UploadVisionSuggestController extends Controller
|
||||
|
||||
public function __invoke(int $id, Request $request): JsonResponse
|
||||
{
|
||||
if (! $this->vision->isEnabled()) {
|
||||
return response()->json(['tags' => [], 'vision_enabled' => false]);
|
||||
}
|
||||
|
||||
$artwork = Artwork::query()->findOrFail($id);
|
||||
$this->authorizeOrNotFound($request->user(), $artwork);
|
||||
$limit = (int) $request->query('limit', 10);
|
||||
|
||||
return response()->json($this->vision->suggestTags($artwork, $this->normalizer, $limit));
|
||||
return response()->json([
|
||||
'tags' => [],
|
||||
'vision_enabled' => false,
|
||||
'reason' => 'disabled',
|
||||
]);
|
||||
}
|
||||
|
||||
private function authorizeOrNotFound(mixed $user, Artwork $artwork): void
|
||||
|
||||
Reference in New Issue
Block a user