Skip to content

Commit 89947c4

Browse files
committed
feat: make delivery status required in delivery schema and validation
1 parent 84ca766 commit 89947c4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

api/models/delivery.model.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const deliverySchema = new mongoose.Schema(
7777
"On Hold",
7878
"Delivered",
7979
],
80-
default: "Pending",
80+
required: true, // Make it required so admin must choose
8181
index: true,
8282
},
8383

api/utils/validators.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const createDeliverySchema = Joi.object({
5353
"On Hold",
5454
"Delivered"
5555
)
56-
.default("Pending"),
56+
.required(), // Make status required from frontend
5757
});
5858

5959
export const updateStatusSchema = Joi.object({

0 commit comments

Comments
 (0)