mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Updates for async and await - still
This commit is contained in:
parent
febb36d75f
commit
706c5dc3ef
18 changed files with 220 additions and 233 deletions
|
|
@ -12,19 +12,19 @@ ShopLists.allow({
|
|||
});
|
||||
|
||||
Meteor.methods({
|
||||
'add.shopList' (shopName) {
|
||||
async 'add.shopList' (shopName) {
|
||||
check(shopName, Sring);
|
||||
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('You are not allowed to add shopping lists. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
return ShopLists.insert({
|
||||
return await ShopLists.insert({
|
||||
shopName: shopName,
|
||||
shopOwner: this.userId,
|
||||
});
|
||||
},
|
||||
'edit.shopList' (shopId, shopName) {
|
||||
async 'edit.shopList' (shopId, shopName) {
|
||||
check(shopId, String);
|
||||
check(shopName, String);
|
||||
|
||||
|
|
@ -32,19 +32,19 @@ Meteor.methods({
|
|||
throw new Meteor.Error('You are not allowed to edit shopping lists. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
return ShopLists.update({ _id: shopId }, {
|
||||
return await ShopLists.update({ _id: shopId }, {
|
||||
$set: {
|
||||
shopName: shopName,
|
||||
}
|
||||
});
|
||||
},
|
||||
'delete.shopList' (shopId) {
|
||||
async 'delete.shopList' (shopId) {
|
||||
check(shopId, String);
|
||||
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('You are not allowed to delete shopping lists. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
return ShopLists.remove({ _id: shopId });
|
||||
return await ShopLists.remove({ _id: shopId });
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue