Owner should only be able to complete an active rental not a confirmed rental. Removed an icon

This commit is contained in:
jackiettran
2026-01-01 23:49:03 -05:00
parent 0682494ee0
commit 0104f369a9
3 changed files with 18 additions and 24 deletions

View File

@@ -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",
});
}