From 6ff7bea0d01900bf9b892e089382e91821c64189 Mon Sep 17 00:00:00 2001 From: Ildar Nurislamov Date: Tue, 28 Nov 2023 17:46:13 +0400 Subject: [PATCH] fix --- webapps/console/pages/api/admin/domains.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webapps/console/pages/api/admin/domains.ts b/webapps/console/pages/api/admin/domains.ts index d3b75f4f6..32b285037 100644 --- a/webapps/console/pages/api/admin/domains.ts +++ b/webapps/console/pages/api/admin/domains.ts @@ -7,12 +7,12 @@ export const api: Api = { handle: async ({ req, query, res }) => { const token = query.token; if (!token || process.env.CADDY_TOKEN !== token) { - res.status(401).json({ error: "Unauthorized" }); + res.status(401).send({ error: "Unauthorized" }); return; } const domain = query.domain; if (!domain) { - res.status(400).json({ error: "missing required parameter" }); + res.status(400).send({ error: "missing required parameter" }); return; } const stream = await db.prisma().configurationObject.findFirst({ @@ -26,10 +26,10 @@ export const api: Api = { }, }); if (!stream) { - res.status(404).json({ error: "not found" }); + res.status(404).send({ error: "not found" }); return; } - res.status(200).json({ ok: true }); + res.status(200).send({ ok: true }); }, }, };