Skip to content

Commit

Permalink
Handle unknown HTTP method in MediaController
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor authored Oct 26, 2023
1 parent 384ccb0 commit 56766b0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Http/Controllers/MediaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function __invoke(Request $request): JsonResponse
'GET' => new JsonResponse($field->paginate($request, $model)),
'POST' => new JsonResponse($field->upload($request, $model), JsonResponse::HTTP_CREATED),
'DELETE' => new JsonResponse(['deleted' => $field->prune($request, $model, $request->input('ids', []))]),
default => throw new \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException(),
};
}
}

0 comments on commit 56766b0

Please sign in to comment.