-
Notifications
You must be signed in to change notification settings - Fork 0
/
deleted-code.txt
132 lines (108 loc) · 2.57 KB
/
deleted-code.txt
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
getAll: function(req, res) {
// console.log('getting bookings for', req.user._id);
// Booking.aggregate([{
// $match: {
// 'user.tempId': req.user._id
// }
// },
// {
// $unwind: "$activity"
// }, {
// $lookup: {
// from: 'activities',
// localField: 'activity.objId',
// foreignField: '_id',
// as: 'activityDetail'
// }
// },
// {
// '$sort': {
// 'activity.dateBooked': -1
// }
// },
// ], function(err, result) {
// if (err) {
// next(err);
// } else {
// res.json(result);
// }
// });
Booking.findOne({
'user.tempId': req.user._id
}, function(err, bookings) {
if (err) {
throw new Error(err);
}
res.json(bookings);
});
},
function getActivity(id) {
Activity.findOne({
_id: id
}, function(err, data) {
if (err) {
throw new Error(err);
}
console.log('act', data);
return data;
});
}
function getTour(id) {
Tour.findOne({
_id: id
}, callback);
}
function getTransfer(id) {
Transfer.findOne({
_id: id
}, callback);
}
function callback(err, data) {
if (err) {
throw new Error(err);
}
// console.log('act', data);
return data;
}
getAll: function(req, res) {
var bookingsData = {};
var activities = [{}];
for (t = 0; t < bookings.activity.length; t++) {
// console.log(bookings.activity[t]);
var d = bookings.activity[t];
Activity.findOne({
_id: bookings.activity[t].objId
}, function(err, data) {
if (err) {
throw new Error(err);
}
var x = {
'details': data,
'bookings': d
};
// console.log(d, data);
activities.push(x);
// console.log(x);
});
}
console.log('activity', activities);
"angular-material": "^1.1.4",
"angular-ui-router": "^1.0.3",
// If session exists
if(typeof req.session.passport != 'undefined')
// return res.send({ user: req.session.passport.user });
res.redirect('/user/profile/' + req.session.passport.user._id);
input(type='text',name='firstName',ng-model='addCtrl.user.firstName')
input(type='text',name='lastName',ng-model='addCtrl.user.lastName')
input(type='text',name='email',ng-model='addCtrl.user.email')
input(type='text',name='password',ng-model='addCtrl.user.pwd')
input(type='text',name='mobile',ng-model='addCtrl.user.mobile')
button(class='btn btn-info' ng-click='addCtrl.add()') Update
Users page
a(href='{{user._id}}')
// console.log('text');
// userService.getUser($routeParams.id).then(function(usr) {
// console.log('getUser', usr);
// vm.user = usr;
// });
//