Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d9e792a
Batch Accept done
ManethKulatunge Dec 15, 2019
76c0b7c
Route created
ManethKulatunge Dec 16, 2019
e5d09fa
Routes constant edited
ManethKulatunge Dec 16, 2019
1494814
Middleware added
ManethKulatunge Dec 16, 2019
2722d76
Sending emails for multiple ids enabled
ManethKulatunge Jan 11, 2020
1236ad2
routes.constant.js edited
ManethKulatunge Jan 11, 2020
46d0037
ensure authorised added
ManethKulatunge Jan 11, 2020
c6c1355
Middleware made to handle errors
ManethKulatunge Jan 11, 2020
282a300
Req.body.ids check
ManethKulatunge Jan 12, 2020
d70c5c6
Tests written
ManethKulatunge Jan 12, 2020
b86bd10
'develop' -> feature/153-accept-multiple-hackers
pierreTklein Jul 25, 2020
0ffda41
Add HACKER_UPDATE_BATCH success message
pierreTklein Jul 26, 2020
97a1f19
Add promise.allsettled so that we can wait for many promises to complete
pierreTklein Jul 26, 2020
5273a55
Add findByHackerId function to Account
pierreTklein Jul 26, 2020
978076d
Add completedBatchUpdate controller function, generalize validation f…
pierreTklein Jul 26, 2020
4c83f60
Fix middleware. Add many tests.
pierreTklein Jul 26, 2020
103d435
Fix bug where requests hang when response is null
pierreTklein Jul 26, 2020
691e4c8
rename completedBatchUpdate to updatedHackerBatch
pierreTklein Jul 26, 2020
cd558b5
Set apiVersion number to be 3.0.0
pierreTklein Jul 26, 2020
e14f9b0
Create and then use parseAcceptBatch instead of parseAccept
pierreTklein Jul 26, 2020
23d8a8b
Merge branch 'develop' into feature/153-accept-multiple-hackers
pierreTklein Jul 27, 2020
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
7 changes: 6 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: 165
* next avaiable createFromTime value: 166
*
* 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 @@ -178,6 +178,11 @@ const hackerRoutes = {
uri: "/api/hacker/acceptEmail/" + Constants.ROLE_CATEGORIES.ALL,
_id: mongoose.Types.ObjectId.createFromTime(130)
},
patchAcceptHackerByArrayOfIds: {
requestType: Constants.REQUEST_TYPES.PATCH,
uri: "/api/hacker/batchAccept",
_id: mongoose.Types.ObjectId.createFromTime(165)
},
postAnySendWeekOfEmail: {
requestType: Constants.REQUEST_TYPES.POST,
uri: "/api/hacker/email/weekOf/" + Constants.ROLE_CATEGORIES.ALL,
Expand Down
3 changes: 3 additions & 0 deletions constants/success.constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const HACKER_GET_BY_ID = "Hacker found by id.";
const HACKER_READ = "Hacker retrieval successful.";
const HACKER_CREATE = "Hacker creation successful.";
const HACKER_UPDATE = "Hacker update successful.";
const HACKER_UPDATE_BATCH = "Hacker batch update successful.";
const HACKER_SENT_WEEK_OF = "Hacker week-of email sent.";
const HACKER_SENT_DAY_OF = "Hacker day-of email sent.";

Expand Down Expand Up @@ -76,6 +77,8 @@ module.exports = {
HACKER_CREATE: HACKER_CREATE,
HACKER_UPDATE: HACKER_UPDATE,

HACKER_UPDATE_BATCH: HACKER_UPDATE_BATCH,

HACKER_SENT_WEEK_OF: HACKER_SENT_WEEK_OF,
HACKER_SENT_DAY_OF: HACKER_SENT_DAY_OF,

Expand Down
11 changes: 11 additions & 0 deletions controllers/hacker.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,19 @@ function sentDayOfEmail(req, res) {
});
}

function updatedHackerBatch(req, res) {
return res.status(200).json({
message: Constants.Success.HACKER_UPDATE_BATCH,
data: {
success_ids: req.body.ids,
errors: req.errors || []
}
});
}

module.exports = {
updatedHacker: updatedHacker,
updatedHackerBatch: updatedHackerBatch,
createdHacker: createdHacker,
uploadedResume: uploadedResume,
downloadedResume: downloadedResume,
Expand Down
Loading