feat: complete day 2
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user