-
Notifications
You must be signed in to change notification settings - Fork 131
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
Sunglasses-io Node Eval - WLA #151
base: master
Are you sure you want to change the base?
Conversation
…cts, GET /me/cart, POST /me/cart, and DELETE /me/cart/:productId
let brands = []; | ||
let products = []; | ||
let users = []; | ||
let accessTokens = []; |
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.
any variable that you don't reassign, should be a const
const currentAccessToken = accessTokens.find((accessToken=>accessToken.token == parsedUrl.query.accessToken)); | ||
|
||
if (currentAccessToken) { | ||
return currentAccessToken; |
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.
could use a ternary here to make this easier to read
return null; | ||
}; | ||
} else { | ||
return null; |
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.
seems repetitive
|
||
response.writeHead(200, { "Content-Type": "application/json" }); | ||
return response.end(JSON.stringify(userCart)); | ||
}) |
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.
missing semi-colon
}; | ||
|
||
// plus 1 quantity of desired product | ||
foundProduct.quantity += 1; |
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.
Could also use ++
No description provided.