Skip to content

Commit

Permalink
Merge pull request #108 from manipalutsav/feature-optional-certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
abhikpai authored Apr 8, 2024
2 parents a147392 + 92d0a6f commit bb7883e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/controllers/colleges.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ const getParticipants = async (req, res) => {
name: participant.name,
college: participant.college,
faculty: participant.faculty,
certificateEligible: participant.certificateEligible,
}));


return res.json({
status: 200,
message: "Success",
Expand Down
1 change: 1 addition & 0 deletions src/controllers/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,7 @@ const addBulkParticipants = (data, college) => {
name: each.name,
college: college,
faculty: each.faculty,
certificateEligible: true,
});
members.push(participant._id);
participant.save(err => {
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/participants.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const update = async (req, res) => {

if (req.body.name) participant.name = req.body.name;
if (req.body.registrationID) participant.registrationID = req.body.registrationID;

if (req.body.certificateEligible !== undefined) participant.certificateEligible = req.body.certificateEligible;
await participant.save();

return res.json({
Expand Down
4 changes: 4 additions & 0 deletions src/models/Participant.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ const schema = {
required: true,
default: false,
},
certificateEligible: {
type: Boolean,
default: true,
}
};

const options = {
Expand Down

0 comments on commit bb7883e

Please sign in to comment.