diff --git a/routes/events/Event.js b/routes/events/Event.js index 5ef09bc..36e4233 100644 --- a/routes/events/Event.js +++ b/routes/events/Event.js @@ -37,12 +37,20 @@ router.post("/create", async (req, res) => { !uid || !data.description || !data.coverImage || - !data.mode || - !data.city || - !data.state || - !data.country || - !data.address || - !data.mapIframe + !data.mode + ) { + return res + .status(STATUSCODE.BAD_REQUEST) + .json({ message: "Missing Required Fields" }); + } + + if ( + data.mode === "Offline" && + (!data.city || + !data.state || + !data.country || + !data.address || + !data.mapIframe) ) { return res .status(STATUSCODE.BAD_REQUEST) diff --git a/schema/events/EventSchema.js b/schema/events/EventSchema.js index 00812b2..ead6ba0 100644 --- a/schema/events/EventSchema.js +++ b/schema/events/EventSchema.js @@ -59,6 +59,14 @@ const EventSchema = new mongoose.Schema({ type: String, trim: true, }, + platform: { + type: String, + trim: true, + }, + platformLink: { + type: String, + trim: true, + }, // date: { // type: Date, // required: true,