Created
March 17, 2017 09:55
-
-
Save harry-jones/8b85b0e419d218ea1c2d04a92fc13ac5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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