Skip to content

Commit

Permalink
fix upload waiver not working if attendingRetreat left blank
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleyleal committed Jul 31, 2024
1 parent 77e7286 commit b226fd6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server/src/middlewares/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ router.post('/upload-waiver', (req, res) => {
req.file.originalname,
)}`;

if (!user.waiver) {
user.waiver = {};
}

if (user.attendingRetreat === null || user.attendingRetreat === undefined) {
user.attendingRetreat = true;
}

// save to MongoDB
user.waiver = {
filename,
Expand Down

0 comments on commit b226fd6

Please sign in to comment.