-
Notifications
You must be signed in to change notification settings - Fork 1
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
Create new admin Azure Functions app and migrate Functions over #112
base: master
Are you sure you want to change the base?
Conversation
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.
🙅♂
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 var
s 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use let
instead of var
context.done(err); | ||
} | ||
else { | ||
if (req.method == 'POST') { |
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 better practice, if it works
} else if (req.method == 'PUT') { | ||
deleteShifts(); | ||
} else if (req.method == 'POST') { | ||
if (req.method == 'POST') { |
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.
eqeqeq
} | ||
}); | ||
|
||
request.on('doneProc', function (rowCount, more, rows) { |
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.
Arrow function might be a bit cleaner imo
|
||
request = new Request( | ||
queryString, | ||
function (err) { |
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.
Consider arrow function for lambda functions
} | ||
}); | ||
|
||
request.on('row', function (columns) { |
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.
prefer-arrow-callback
}); | ||
|
||
function getShifts() { | ||
var queryString = |
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.
Use let
to preserve scope
module.exports = function (context, req) { | ||
var shifts = []; | ||
|
||
var connection = new Connection(config); |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let
or const
instead of var
} | ||
|
||
function insertLocation(locations) { | ||
var options = { keepNulls: true }; |
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.
let
or const
instead of var
No description provided.