Skip to content
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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

thaingocnguyen
Copy link
Collaborator

No description provided.

@thaingocnguyen thaingocnguyen linked an issue Apr 4, 2020 that may be closed by this pull request
Copy link
Collaborator

@justinkkwan justinkkwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


const { firstName, lastName, email, phone, streetAddress, postalCode, mailingList } = formInput;

var queryString = 'INSERT INTO Volunteer (firstName, lastName, phoneNumber, email, address, postalCode, mailingList, emergencyContactId, isDeleted) \
Copy link
Collaborator

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') {
Copy link
Collaborator

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') {
Copy link
Collaborator

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) {
Copy link
Collaborator

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) {
Copy link
Collaborator

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) {
Copy link
Collaborator

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 =
Copy link
Collaborator

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);
Copy link
Collaborator

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 = [];
Copy link
Collaborator

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 };
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new azure function app
2 participants