Skip to content

Instantly share code, notes, and snippets.

@harry-jones
Created March 17, 2017 09:55
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 harry-jones/8b85b0e419d218ea1c2d04a92fc13ac5 to your computer and use it in GitHub Desktop.
Save harry-jones/8b85b0e419d218ea1c2d04a92fc13ac5 to your computer and use it in GitHub Desktop.
// find the existing customer or create a new one
Customer.findOrCreate({email: customer.email}, customer).exec(function (err, customerFound) {
if (err) {
sails.log(vehicle.vrm + ': error finding or creating customer');
sails.log(err);
return res.serverError(500);
}
else {
sails.log(vehicle.vrm + ": customer ID " + customerFound.id);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment