From 393a1e201dc13dc159731d7f1e1d21182ba8c660 Mon Sep 17 00:00:00 2001 From: Inga <52715130+inga-lovinde@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:17:31 +0000 Subject: [PATCH] added information on 400 Bad Request for empty requests to search --- solution.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/solution.md b/solution.md index bf74de7..a4f9e25 100644 --- a/solution.md +++ b/solution.md @@ -178,6 +178,9 @@ Another thing regarding search is that it seems that for most fields, it does no So I limited the search feature to a subset of fields, as described in `SearchFilters` type in [`types.ts`](src/types.ts) and in `SearchDto` in [`movies.controller.ts`](src/movies.controller.ts). +And finally, it does not make a lot of sense to search by an empty query (we probably don't want to just list our entire database to whoever +did not enter any search filters), so I return a 400 Bad Request errors for request to search endpoint with empty query. + ## Testing I did not have any time to come up with a good test cases, so most tests work on samples of data from OMDB and on provided sample JSONs.