Create new admin Azure Functions app and migrate Functions over#112
Create new admin Azure Functions app and migrate Functions over#112thaingocnguyen wants to merge 11 commits intomasterfrom
Conversation
justinkkwan
left a comment
There was a problem hiding this comment.
🙅♂
A lot of my suggestions are just based on eslint rules
https://eslint.org/docs/rules/prefer-arrow-callback
https://eslint.org/docs/rules/no-var
https://eslint.org/docs/rules/eqeqeq
But vars are actually bad practice
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var
|
|
||
| const { firstName, lastName, email, phone, streetAddress, postalCode, mailingList } = formInput; | ||
|
|
||
| var queryString = 'INSERT INTO Volunteer (firstName, lastName, phoneNumber, email, address, postalCode, mailingList, emergencyContactId, isDeleted) \ |
There was a problem hiding this comment.
Use let instead of var
| context.done(err); | ||
| } | ||
| else { | ||
| if (req.method == 'POST') { |
There was a problem hiding this comment.
=== is better practice, if it works
| } else if (req.method == 'PUT') { | ||
| deleteShifts(); | ||
| } else if (req.method == 'POST') { | ||
| if (req.method == 'POST') { |
| } | ||
| }); | ||
|
|
||
| request.on('doneProc', function (rowCount, more, rows) { |
There was a problem hiding this comment.
Arrow function might be a bit cleaner imo
|
|
||
| request = new Request( | ||
| queryString, | ||
| function (err) { |
There was a problem hiding this comment.
Consider arrow function for lambda functions
| } | ||
| }); | ||
|
|
||
| request.on('row', function (columns) { |
| }); | ||
|
|
||
| function getShifts() { | ||
| var queryString = |
There was a problem hiding this comment.
Use let to preserve scope
| module.exports = function (context, req) { | ||
| var shifts = []; | ||
|
|
||
| var connection = new Connection(config); |
There was a problem hiding this comment.
let or const instead of var
| var TYPES = require('tedious').TYPES; | ||
|
|
||
| module.exports = function (context, req) { | ||
| var shifts = []; |
There was a problem hiding this comment.
let or const instead of var
| } | ||
|
|
||
| function insertLocation(locations) { | ||
| var options = { keepNulls: true }; |
There was a problem hiding this comment.
let or const instead of var
No description provided.