| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| } | ||
| }); | ||
| } | ||
| req.body.travelDetails.request = hacker.application.accommodation.travel; |
There was a problem hiding this comment.
return next()?
Sorry, something went wrong.
| * @param {JSON} res | ||
| * @param {(err?)=>void} next | ||
| * @return {void} | ||
| * @description Load travel request from hacker application and add it to |
There was a problem hiding this comment.
Nit: add it to req.body.travelDetails
Sorry, something went wrong.
| const travelDetails = req.body.travelDetails; | ||
|
|
||
| const exists = await Services.Hacker.findByAccountId( | ||
| travelDetails.accountId |
There was a problem hiding this comment.
Need to change this to instead look for a travel record by accountID instead to ensure we don't make duplicate travel docs for same linked accs. The way it is now, it is just looking for a hacker associated to an accountID which is not what we want I think.
Sorry, something went wrong.
There was a problem hiding this comment.
True true
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM! functionality seems great
@MrHarshPatel if it's good on the technical side, ready to merge
Sorry, something went wrong.
| post: { | ||
| requestType: Constants.REQUEST_TYPES.POST, | ||
| uri: "/api/travel/" | ||
| }, |
There was a problem hiding this comment.
what is this post? Did you mean create travel?
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, it's for create - thought I was following the naming convention from account and hacker, would it be better to rename this from post to createTravel?
Sorry, something went wrong.
| function updatedTravel(req, res) { | ||
| return res.status(200).json({ | ||
| message: Constants.Success.TRAVEL_UPDATE, | ||
| data: req.body |
There was a problem hiding this comment.
Should this be json like the other portions or no?
Sorry, something went wrong.
| Error: require("../constants/error.constant") | ||
| }; | ||
|
|
||
| function okay(req, res) { |
There was a problem hiding this comment.
nit: okay sounds a bit odd as a function name
Sorry, something went wrong.
There was a problem hiding this comment.
Whoops, this function was just for debugging - I'll remove it
Sorry, something went wrong.
| function addDefaultStatusAndOffer(req, res, next) { | ||
| req.body.travelDetails.status = "None"; | ||
| req.body.travelDetails.offer = 0; | ||
| return next(); |
There was a problem hiding this comment.
Can this be added in parseTravel? or is this used for a specific purpose?
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Tickets:
List of changes:
Create a travel model and api. Model is of form
{ _id: ObjectId // The id of the travel document hackerId: ObjectId // The id of the hacker that is traveling accountId: ObjectId // The id of the user that is traveling request: number // The amount of money the hacker is requesting for travel offer: number // The amount of money we are giving the hacker for travel status: string // The state of the hacker's travel request }Following api end points were also created:
Type of change
Please delete options that are not relevant.
How has this been tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Firmware version:
Hardware:
Toolchain:
SDK:
Questions for code reviewers?
Checklist: