Browse Source

Commit 9.4: Update insert to include user data.

Frederic G. MARAND 8 years ago
parent
commit
ebf3f07b45
1 changed files with 3 additions and 1 deletions
  1. 3 1
      simple-todos.js

+ 3 - 1
simple-todos.js

@@ -31,7 +31,9 @@ if (Meteor.isClient) {
 
       Tasks.insert({
         text: text,
-        createdAt: new Date() // current time
+        createdAt: new Date(),    // current time
+        owner: Meteor.userId(),   // _id of logged-in user
+        username: Meteor.user().username
       });
 
       // Clear form