Closed vblackburn closed 9 years ago
This error happen when I attempt to enter a new project. How can I correct this to allow me to add new projects?
'saveProject':function(project){ check(project.name,String); project.userId = Meteor.userId(); project.dateentered = new Date(); project.lastupdate = new Date(); if(!project.datedue){ project.datedue = new Date(); } if(!project.customer){ project.customer = Customers.findOne({})._id; } project.invited = []; return Projects.insert(project); }
Template.dashboard.events({ 'keyup input[type=text]': function(event,tmpl) { if(event.which === 27 || event.which === 13){ event.preventDefault(); var project = {}; project.name = tmpl.find('#projectNameEnter').value; Meteor.call('saveProject',project); } }, });
Have you tried adding a customer ? I believe this will error if there are no customers.
Thanks this worked, really appreciate the help
This error happen when I attempt to enter a new project. How can I correct this to allow me to add new projects?
Here is my saveProject method;
Here is the template that calls it;