Created
March 28, 2016 06:29
-
-
Save dai-shi/8b1e7226bd5a708eef54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/imports/ui/Task.jsx b/imports/ui/Task.jsx | |
index 5650fa0..ee040c5 100644 | |
--- a/imports/ui/Task.jsx | |
+++ b/imports/ui/Task.jsx | |
@@ -1,18 +1,15 @@ | |
import React, { Component, PropTypes } from 'react'; | |
- | |
-import { Tasks } from '../api/tasks.js'; | |
+import { Meteor } from 'meteor/meteor'; | |
// Task component - represents a single todo item | |
export default class Task extends Component { | |
toggleChecked() { | |
// Set the checked property to the opposite of its current value | |
- Tasks.update(this.props.task._id, { | |
- $set: { checked: !this.props.task.checked }, | |
- }); | |
+ Meteor.call('tasks.setChecked', this.props.task._id, !this.props.task.checked); | |
} | |
deleteThisTask() { | |
- Tasks.remove(this.props.task._id); | |
+ Meteor.call('tasks.remove', this.props.task._id); | |
} | |
render() { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment