From 719e25d8254fd9ab2516f5faf6d2f07af4257792 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 20 Oct 2024 14:29:11 +0000 Subject: feature: Add DELETE REST APIs for bookmarks, lists and tags --- apps/web/app/api/v1/utils/handler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/web/app/api/v1/utils') diff --git a/apps/web/app/api/v1/utils/handler.ts b/apps/web/app/api/v1/utils/handler.ts index d66bb299..d5f470df 100644 --- a/apps/web/app/api/v1/utils/handler.ts +++ b/apps/web/app/api/v1/utils/handler.ts @@ -81,7 +81,7 @@ export async function buildHandler< bodySchema, }: { req: NextRequest; - handler: (req: InputT) => Promise<{ status: number; resp: object }>; + handler: (req: InputT) => Promise<{ status: number; resp?: object }>; searchParamsSchema?: SearchParamsT | undefined; bodySchema?: BodyT | undefined; }) { @@ -108,7 +108,7 @@ export async function buildHandler< body, } as InputT); - return new Response(JSON.stringify(resp), { + return new Response(resp ? JSON.stringify(resp) : null, { status, headers: { "Content-Type": "application/json", -- cgit v1.2.3-70-g09d2