This commit is contained in:
Janis
2023-02-02 00:00:44 +01:00
parent 585e36e4b9
commit 2f340537d4
14 changed files with 77 additions and 24 deletions

View File

@@ -22,7 +22,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
code: "404",
message: "No article with this name found!",
};
res.status(404).send(JSON.stringify(error));
res.status(404).json(error);
}
})
.catch((err) => {
@@ -31,6 +31,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
code: "500",
message: err,
};
res.status(500).send(JSON.stringify(error));
res.status(500).json(error);
});
}