feat: initial tests for api-keys endpoint

This commit is contained in:
Agusti Fernandez Pardo committed 2022-03-26 00:42:12 +01:00
1 parent f80f23d3c3
commit 9e8be659c5
6 files changed
+95 -13

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ export async function apiKey(req: NextApiRequest, res: NextApiResponse<ResponseD
const apiKey = await prisma.apiKey.findUnique({ where: { id: safe.data.id } });
if (apiKey) res.status(200).json({ data: apiKey });
if (!apiKey) res.status(404).json({ message: "Event type not found" });
if (!apiKey) res.status(404).json({ message: "API key was not found" });
} else {
// Reject any other HTTP method than POST
res.status(405).json({ message: "Only GET Method allowed" });