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