import { Template } from 'meteor/templating';
import { Tasks } from '../api/tasks.js';

import './task.html';

Template.task.events({
  'click .toggle-checked'() {
    Tasks.update(this._id, {
      $set: { checked: ! this.checked },
    });
  },
  'click .delete'() {
    Tasks.remove(this._id);
  },
});

@@ -165,55 +165,49 @@
     
-Tasks.update(this._id, %7B%0A      $set: %7B checked:
+Meteor.call('tasks.setChecked', this._id,
  ! t
@@ -221,17 +221,8 @@
 cked
- %7D,%0A    %7D
 );%0A 
@@ -251,17 +251,30 @@
 ) %7B%0A    
-T
+Meteor.call('t
 asks.rem
@@ -276,17 +276,19 @@
 s.remove
-(
+', 
 this._id

change task db methods to Meteor.call