Owner should only be able to complete an active rental not a confirmed rental. Removed an icon
This commit is contained in:
@@ -875,9 +875,9 @@ router.post("/:id/mark-completed", authenticateToken, async (req, res) => {
|
||||
.json({ error: "Only owners can mark rentals as completed" });
|
||||
}
|
||||
|
||||
if (!["active", "confirmed"].includes(rental.status)) {
|
||||
if (rental.status !== "active") {
|
||||
return res.status(400).json({
|
||||
error: "Can only mark active or confirmed rentals as completed",
|
||||
error: "Can only mark active rentals as completed",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1197,9 +1197,9 @@ router.post("/:id/mark-return", authenticateToken, async (req, res, next) => {
|
||||
.json({ error: "Only the item owner can mark return status" });
|
||||
}
|
||||
|
||||
if (!["confirmed", "active"].includes(rental.status)) {
|
||||
if (rental.status !== "active") {
|
||||
return res.status(400).json({
|
||||
error: "Can only mark return status for confirmed or active rentals",
|
||||
error: "Can only mark return status for active rentals",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user