|
@@ -29,12 +29,8 @@ if (Meteor.isClient) {
|
|
|
|
|
|
var text = event.target.text.value;
|
|
|
|
|
|
- Tasks.insert({
|
|
|
- text: text,
|
|
|
- createdAt: new Date(), // current time
|
|
|
- owner: Meteor.userId(), // _id of logged-in user
|
|
|
- username: Meteor.user().username
|
|
|
- });
|
|
|
+ // Insert a task into the collection.
|
|
|
+ Meteor.call('addTask', text);
|
|
|
|
|
|
// Clear form
|
|
|
event.target.text.value = "";
|
|
@@ -75,7 +71,7 @@ Meteor.methods({
|
|
|
text: text,
|
|
|
createdAt: new Date(),
|
|
|
owner: Meteor.userId(),
|
|
|
- username: Meteor.user().name
|
|
|
+ username: Meteor.user().username
|
|
|
};
|
|
|
Tasks.insert(task);
|
|
|
},
|