I get expression expected in my client/template/test.html in Meteor, but it still manages to run?
Meteor.call('addTestTicket', userid, date_start, date_end, (error, data) => {
if (error) {
Bert.alert('Please login before trying to submit!', 'danger', 'growl-top-right', 'fa-frown-o');
} else {
Bert.alert({title: 'Test Sent', message: 'now in queue', type: 'info', style: 'growl-top-right', icon: 'fa-music'});
Meteor.setTimeout(function(){window.location.href = '/';}, 3000);
console.log('the added ticket is : ', data); }
}); <!-- End of Meteor.call -->
server.js:
Meteor.methods({
addTestTicket: function (text, start_date, end_date) {
if (!Meteor.userId()) {
//Add Bert notification here?
//Bert.alert('Please login before submitting', 'danger', 'fixed-top', 'fa-frown-o');
throw new Meteor.Error('Not authorized');
}
//Generate random fake tickets TESTxxxxx
var fakeTicketNo = Random.hexString(6);
console.log('Random TicketNo is : ', fakeTicketNo);
FutureTasks.insert({
userid: text, '
assigned_to: 'Testing',
number: ''.concat("TEST", demoTicketNo),
assignment_group: 'Test',
start_date: start_date,
end_date: end_date,
count: 0
});
}