Updated the validateSchema util

This commit is contained in:
2023-01-08 03:25:12 +01:00
parent cb441df58b
commit e6b11fee5f
5 changed files with 13 additions and 13 deletions

View File

@ -9,7 +9,7 @@ app.get("/", async (req, res) => {
app.put("/", async (req, res) => {
const error = await validateSchema(domainValidation, req.body);
if (error) return res.status(400).json({message: error});
if (error) return res.status(400).json(error);
const domain = await createDomain(req.body.domainName);
if (domain === null) return res.status(409).json({message: "This domain already exists"});
@ -24,4 +24,4 @@ app.delete("/:domain", async (req, res) => {
res.json({message: "The provided domain has been successfully removed"});
});
module.exports = app;
module.exports = app;