-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmethod.js
More file actions
45 lines (33 loc) · 1.08 KB
/
method.js
File metadata and controls
45 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
import { Tasks } from '../imports/api/tasks.js';
import { Arrays } from '../imports/api/tasks.js';
Meteor.methods({
addTasks:function(Email){
Tasks.insert({
Email: Email
});
},
deleteTasks:function(_id){
var task=Tasks.findOne(_id);
Tasks.remove(_id);
},
setChecked:function(_id,setChecked)
{
var task=Tasks.findOne(_id);
Tasks.update(_id,{$set:{checked:setChecked}});
},
// 'changepass': function(userId, newpassword) {
// var authCode = Meteor.users.find({ _id: userId}).fetch();
// if (authCode.length > 0) {
// Accounts.setPassword(userId, newpassword);
// let a = Meteor.users.update({ _id: userId }, {$set:{"services.password": newpassword}} );
// return true;
// }
// },
insertaddress:function(form){
var currentuserId=Meteor.userId();
var addressdata=_.extend(form,{created_Date:new Date(),created_By:currentuserId}); //_.extend copies the properties of each source to destination
var addressdetails=Arrays.insert(addressdata);
},
});