feat: complete day 2

This commit is contained in:
Ayobami
2025-07-11 18:05:50 +01:00
parent b277c8182d
commit 325788cb39
8 changed files with 456 additions and 5 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ router.post("/", async (req, res) => {
return handleError("Name is required and cannot be empty", 400, res);
}
await ShippingDock.create(req.body);
handleSuccess(res, dock, 201);
handleSuccess(res, null, 201);
} catch (err) {
handleError(err.message, 500, res);
}
@@ -85,7 +85,7 @@ router.delete("/:id", async (req, res) => {
where: { id: req.params.id },
});
if (deleted === 0) return handleError("Dock not found", 404, res);
handleSuccess(res, null, 204); // 204 No Content
handleSuccess(res, null);
} catch (err) {
handleSequelizeError(err, res);
}