Added a delete confirmation modal to all views.

This commit is contained in:
Brian McGonagill 2022-08-26 11:18:18 -05:00
parent 4d9d2acff6
commit 29ddc544e5
27 changed files with 117 additions and 127 deletions

View file

@ -45,13 +45,6 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete categories. Make sure you are logged in with valid user credentials.');
}
let categoryInfo = Categories.findOne({ _id: categoryId });
let myId = this.userId;
if (myId == categoryInfo.owner) {
return Categories.remove({ _id: categoryId });
} else {
console.log("User not allowed to delete this Category. Not the owner!");
return("Not Allowed!");
}
return Categories.remove({ _id: categoryId });
},
});

View file

@ -29,7 +29,7 @@ Meteor.methods({
if (err) {
console.log(" ERROR adding item to products: " + err);
} else {
console.log(" SUCCESS adding item to Products.");
// console.log(" SUCCESS adding item to Products.");
return ListItems.insert({
itemName: itemName,
listId: listId,

View file

@ -50,14 +50,7 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete lists. Make sure you are logged in with valid user credentials.');
}
let listInfo = Lists.findOne({ _id: listId });
let myId = this.userId;
if (myId == listInfo.listOwner) {
return Lists.remove({ _id: listId });
} else {
console.log("User not allowed to delete this list. Not the owner!");
return("Not Allowed!");
}
return Lists.remove({ _id: listId });
},
'mark.complete' (listId) {
check(listId, String);

View file

@ -45,13 +45,6 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete locations. Make sure you are logged in with valid user credentials.');
}
let locationInfo = Locations.findOne({ _id: locationId });
let myId = this.userId;
if (myId == locationInfo.owner) {
return Locations.remove({ _id: locationId });
} else {
console.log("User not allowed to delete this location. Not the owner!");
return("Not Allowed!");
}
return Locations.remove({ _id: locationId });
},
});

View file

@ -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 });
},
});

View file

@ -45,13 +45,6 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to delete stores. Make sure you are logged in with valid user credentials.');
}
let storeInfo = Stores.findOne({ _id: storeId });
let myId = this.userId;
if (myId == storeInfo.owner) {
return Stores.remove({ _id: storeId });
} else {
console.log("User not allowed to delete this store. Not the owner!");
return("Not Allowed!");
}
return Stores.remove({ _id: storeId });
},
});