В поля коллекции devices добавляются поля имя и фамилия владельца
This commit is contained in:
parent
0de4709514
commit
dca233da53
|
|
@ -8,7 +8,7 @@ Template.devices_list.device = function () {
|
|||
Template.devices_list.get_name_by_id = function () {
|
||||
var owner = Users.findOne({_id: this.owner_id});
|
||||
if (!owner) return "Не известно";
|
||||
return owner.name + " " + owner.surname;
|
||||
return this.owner_name + " " + this.owner_surname;
|
||||
};
|
||||
|
||||
Template.devices_list.get_checkin_date = function () {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,10 @@ Meteor.startup(function () {
|
|||
|
||||
console.log("-------- Устройство: ", device.name);
|
||||
|
||||
Devices.update(device._id, {$set: {checkin_date: new Date(), owner_id: user._id}});
|
||||
Devices.update(device._id, {$set: {checkin_date: new Date(),
|
||||
owner_id: user._id,
|
||||
owner_name: user.name,
|
||||
owner_surname: user.surname}});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue