Skip to content

Instantly share code, notes, and snippets.

@AbilashK
Created December 23, 2019 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbilashK/bd5dd7cb8128bcc20aed45f985cd15b1 to your computer and use it in GitHub Desktop.
Save AbilashK/bd5dd7cb8128bcc20aed45f985cd15b1 to your computer and use it in GitHub Desktop.
connection.query(checkLocation, [location]).then(function (rows) {
// Location exists
return connection.query(addShop, [shopParams])
}).then(function (rows) {
// Shop added
return connection.query(linkState, [shopParams])
}).then(function (rows) {
// Categorize with state
callback(1);
}).catch(function(err) {
console.log(err);
callback(0);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment