mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Added a delete confirmation modal to all views.
This commit is contained in:
parent
4d9d2acff6
commit
29ddc544e5
27 changed files with 117 additions and 127 deletions
|
|
@ -23,9 +23,6 @@ Meteor.methods({
|
|||
shopName: shopName,
|
||||
shopOwner: this.userId,
|
||||
});
|
||||
},
|
||||
'add.shopListUsers' (userIds) {
|
||||
|
||||
},
|
||||
'edit.shopList' (shopId, shopName) {
|
||||
check(shopId, String);
|
||||
|
|
@ -40,9 +37,6 @@ Meteor.methods({
|
|||
shopName: shopName,
|
||||
}
|
||||
});
|
||||
},
|
||||
'edit.shopListUsers' (shopId, userIds) {
|
||||
|
||||
},
|
||||
'delete.shopList' (shopId) {
|
||||
check(shopId, String);
|
||||
|
|
@ -51,13 +45,6 @@ Meteor.methods({
|
|||
throw new Meteor.Error('You are not allowed to delete shopping lists. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
let shopInfo = ShopLists.findOne({ _id: shopId });
|
||||
let myId = this.userId;
|
||||
if (myId == shopInfo.owner) {
|
||||
return ShopLists.remove({ _id: shopId });
|
||||
} else {
|
||||
console.log("User not allowed to delete this shopping list. Not the owner!");
|
||||
return("Not Allowed!");
|
||||
}
|
||||
return ShopLists.remove({ _id: shopId });
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue