From 34c27e11165c8ca3cf6d99f6696ca1d843fd35e6 Mon Sep 17 00:00:00 2001 From: avdb Date: Fri, 19 Jan 2024 14:25:52 +0100 Subject: [PATCH] Erros can be anything --- src/responses.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/responses.ts b/src/responses.ts index bf78e8c..240907c 100644 --- a/src/responses.ts +++ b/src/responses.ts @@ -12,10 +12,10 @@ export const badRequest = (text = 'Bad Request') => ({ text, }) -export const json = (body: { message: string; errors: [Error] }, status = OK) => ({ +export const json = (body: { message: string; errors: any }, status = OK) => ({ status, body, }) -export const badRequestJson = (result: { message: string; errors: [Error] }) => +export const badRequestJson = (result: { message: string; errors: any }) => json(result, BAD_REQUEST)