Browse Source

Step 10.3: Update App component to use addTask method.

Frederic G. MARAND 8 years ago
parent
commit
091449f45d
1 changed files with 1 additions and 6 deletions
  1. 1 6
      App.jsx

+ 1 - 6
App.jsx

@@ -47,12 +47,7 @@ App = React.createClass({
     // Find the text field via the React ref.
     var text = ReactDOM.findDOMNode(this.refs.textInput).value.trim();
 
-    Tasks.insert({
-      text: text,
-      createdAt: new Date(),           // Current time
-      owner: Meteor.userId(),          // _id of logged-in user
-      username: Meteor.user().username // username of logged-in user
-    });
+    Meteor.call("addTask", text);
 
     // Clear form to allow a new input.
     ReactDOM.findDOMNode(this.refs.textInput).value = '';