Skip to content

Instantly share code, notes, and snippets.

@dai-shi
Created March 28, 2016 06:29
Show Gist options
  • Save dai-shi/8b1e7226bd5a708eef54 to your computer and use it in GitHub Desktop.
Save dai-shi/8b1e7226bd5a708eef54 to your computer and use it in GitHub Desktop.
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