Skip to content

Commit

Permalink
fix: changes for online mode handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalCodes committed Mar 12, 2024
1 parent b24d522 commit 99d90ad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
20 changes: 14 additions & 6 deletions routes/events/Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions schema/events/EventSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 99d90ad

Please sign in to comment.