diff --git a/server/controller/index.ts b/server/controller/index.ts index d682f53..5bd4d61 100644 --- a/server/controller/index.ts +++ b/server/controller/index.ts @@ -85,6 +85,12 @@ export const getRandomQuoteByAnime = async (req: Request, res: Response) => { .orderBy(rand) .limit(1); + if (isEmpty(randomQuote)) { + return res.status(StatusCodes.NOT_FOUND).json({ + error: 'No related quotes found!', + }); + } + res.status(200).json(randomQuote[0]); } catch (error) { console.error('Database Error:', error);