-
Notifications
You must be signed in to change notification settings - Fork 8
Feature/153 accept hacker by email #620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
07e6081
e7c92f6
10b35ae
e570335
91e1082
efce4fc
61fd988
412a116
75003a5
4e86599
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -307,6 +307,37 @@ module.exports = { | |
| Middleware.Hacker.sendStatusUpdateEmail, | ||
| Controllers.Hacker.updatedHacker | ||
| ); | ||
|
|
||
| /** | ||
| * @api {patch} /hacker/acceptEmail/:email accept a Hacker by email | ||
| * @apiName acceptHacker | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: update to be for accept by email |
||
| * @apiGroup Hacker | ||
| * @apiVersion 2.0.0 | ||
| * | ||
| * @apiSuccess {string} message Success message | ||
| * @apiSuccess {object} data Hacker object | ||
| * @apiSuccessExample {object} Success-Response: | ||
| * { | ||
| * "message": "Changed hacker information", | ||
| * "data": { | ||
| * "status": "Accepted" | ||
| * } | ||
| * } | ||
| * @apiPermission Administrator | ||
| */ | ||
| hackerRouter | ||
| .route("/acceptEmail/:email") | ||
| .patch( | ||
| Middleware.Auth.ensureAuthenticated(), | ||
| Middleware.Auth.ensureAuthorized([Services.Hacker.findByEmail]), | ||
| Middleware.Validator.RouteParam.emailValidator, | ||
| Middleware.parseBody.middleware, | ||
| Middleware.Hacker.findByEmail, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is middleware hacker findByEmail and then calling middleware findByEmail duplicate work?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I believe so I'll fix it
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Edit: req.body.hacker is changed by findByEmail so no it is not duplicated work |
||
| Middleware.Hacker.parseAcceptEmail, | ||
| Middleware.Hacker.obtainEmailByHackerId, | ||
| Middleware.Hacker.completeStatusUpdateEmail, | ||
| Controllers.Hacker.updatedHacker | ||
| ); | ||
|
|
||
| /** | ||
| * @api {patch} /hacker/checkin/:id update a hacker's status to be 'Checked-in'. Note that the Hacker must eitehr be Accepted or Confirmed. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this is req.body.hacker.status, i think the update middleware uses req.body.status right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, the comment says req.body.status ^^ Double check it unless you changed it.