Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ assets/.DS_Store

#secrets
secret.yaml
package-lock.json
7 changes: 2 additions & 5 deletions assets/email/statusEmail/Checked-in.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,8 @@
This email is to confirm your check-in at McHacks!
<br><br>
Don't forget to join the McHacks participants <a
href="https://facebook.com/groups/mchacks7"
style="-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;color:#F2463A;text-decoration:none;">Facebook
group</a> and <a
href="https://join.slack.com/t/mchacks7/shared_invite/enQtOTA3MDc2NDU4OTAyLTI0ZWU1N2VkOGExZTA3NDg3Y2JiMGE3MGE2ZmU4MGRlYjI3YmZlYjAxYmI0OTk2ZjZjYTE0ZjNhYmY0ZDNmZmU"
style="-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;color:#F2463A;text-decoration:none;">Slack</a>
href="https://discord.com/invite/fqbjr43cKf"
style="-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;color:#F2463A;text-decoration:none;">Discord</a>
for announcements, to chat with other hackers, ask questions, and form
teams!

Expand Down
1 change: 1 addition & 0 deletions constants/role.constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const hackerRole = {
Constants.Routes.hackerRoutes.patchSelfById,
Constants.Routes.hackerRoutes.patchSelfConfirmationById,
Constants.Routes.hackerRoutes.getSelf,
Constants.Routes.hackerRoutes.postDiscord,

Constants.Routes.travelRoutes.getSelf,
Constants.Routes.travelRoutes.getSelfById,
Expand Down
13 changes: 12 additions & 1 deletion constants/routes.constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* ===***===***===***===***===***===***===***===***===
*
* If you are adding a route to this list, update this number
* next avaiable createFromTime value: 166
* next avaiable createFromTime value: 168
*
* If you are deleting a route from this list, please add the ID to the list of 'reserved' IDs,
* so that we don't accidentally assign someone to a given ID.
Expand Down Expand Up @@ -203,6 +203,12 @@ const hackerRoutes = {
uri: "/api/hacker/email/dayOf/" + Constants.ROLE_CATEGORIES.SELF,
_id: mongoose.Types.ObjectId.createFromTime(134)
}
// },
// postDiscord: {
// requestType: Constants.REQUEST_TYPES.POST,
// uri: "/api/hacker/discord",
// _id: mongoose.Types.ObjectId.createFromTime(167)
// }
};

const travelRoutes = {
Expand Down Expand Up @@ -363,6 +369,11 @@ const staffRoutes = {
requestType: Constants.REQUEST_TYPES.GET,
uri: "/api/account/invite",
_id: mongoose.Types.ObjectId.createFromTime(162)
},
postDiscord: {
requestType: Constants.REQUEST_TYPES.POST,
uri: "/api/hacker/discord",
_id: mongoose.Types.ObjectId.createFromTime(167)
}
};

Expand Down
8 changes: 7 additions & 1 deletion middlewares/hacker.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,11 @@ async function getStats(req, res, next) {
next();
}

function addIdToCheckStatus(req, res, next) {
req.params.id = req.body.hacker.id;
return next();
}

module.exports = {
parsePatch: parsePatch,
parseHacker: parseHacker,
Expand Down Expand Up @@ -929,5 +934,6 @@ module.exports = {
findByEmail: Middleware.Util.asyncMiddleware(findByEmail),
obtainEmailByHackerId: Middleware.Util.asyncMiddleware(
obtainEmailByHackerId
)
),
addIdToCheckStatus: addIdToCheckStatus
};
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions routes/api/hacker.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,23 @@ module.exports = {
Controllers.Hacker.sentDayOfEmail
);

hackerRouter.route("/discord").post(
Middleware.Auth.ensureAuthenticated(),
Middleware.Auth.ensureAuthorized(),

// Middleware.parseBody.middleware,
Middleware.Hacker.findByEmail,
Middleware.Hacker.addIdToCheckStatus,
Middleware.Hacker.checkStatus([
CONSTANTS.HACKER_STATUS_ACCEPTED,
CONSTANTS.HACKER_STATUS_CONFIRMED
]),
Middleware.Hacker.parseCheckIn,
Middleware.Hacker.updateHacker,
Middleware.Hacker.sendStatusUpdateEmail,
Controllers.Hacker.updatedHacker
);

apiRouter.use("/hacker", hackerRouter);
}
};