Change order url to invitee ID, add invitee model

This commit is contained in:
Ben Ramey
2014-05-13 13:11:43 -05:00
parent e4552ebfe4
commit d02bd6c659
10 changed files with 136 additions and 72 deletions

33
api/models/Invitee.js Normal file
View File

@@ -0,0 +1,33 @@
/**
* Invitee
*
* @module :: Model
* @description :: A short summary of how this model works and what it represents.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
attributes: {
name: {
type: 'string',
required: true
},
email: {
type: 'email',
required: true
},
order: {
type: 'string'
},
run_id: {
type: 'string'
}
},
afterCreate: function(values, next) {
EmailService.sendOrderEmail(values);
next();
},
};

View File

@@ -20,17 +20,10 @@ module.exports = {
type: 'email',
required: true
},
invitees: {
type: 'array'
},
menuUrl: {
type: 'url'
},
restaurant: 'string'
},
afterCreate: function(values, next) {
EmailService.sendRunEmails(values);
next();
},
};