Skip to content

Instantly share code, notes, and snippets.

@dai-shi
Created March 28, 2016 06:28
Show Gist options
  • Select an option

  • Save dai-shi/4191cfeb9278417b4419 to your computer and use it in GitHub Desktop.

Select an option

Save dai-shi/4191cfeb9278417b4419 to your computer and use it in GitHub Desktop.
diff --git a/imports/ui/App.jsx b/imports/ui/App.jsx
index bbbb728..4f41c39 100644
--- a/imports/ui/App.jsx
+++ b/imports/ui/App.jsx
@@ -24,12 +24,7 @@ class App extends Component {
// Find the text field via the React ref
const text = ReactDOM.findDOMNode(this.refs.textInput).value.trim();
- Tasks.insert({
- 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('tasks.insert', text);
// Clear form
ReactDOM.findDOMNode(this.refs.textInput).value = '';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment