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,7 +12,7 @@ RecipeItems.allow({
|
|||
});
|
||||
|
||||
Meteor.methods({
|
||||
'add.recipeItem' (recipeId, recipeItemType, recipeItem) {
|
||||
async 'add.recipeItem' (recipeId, recipeItemType, recipeItem) {
|
||||
check(recipeId, String);
|
||||
check(recipeItemType, String);
|
||||
check(recipeItem, String);
|
||||
|
|
@ -21,13 +21,13 @@ Meteor.methods({
|
|||
throw new Meteor.Error('You are not allowed to add recipe items. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
return RecipeItems.insertAsync({
|
||||
return await RecipeItems.insertAsync({
|
||||
recipeId: recipeId,
|
||||
recipeItemType: recipeItemType,
|
||||
recipeItem: recipeItem,
|
||||
});
|
||||
},
|
||||
'edit.recipeItem' (recipeItemId, recipeId, recipeItemType, recipeItem) {
|
||||
async 'edit.recipeItem' (recipeItemId, recipeId, recipeItemType, recipeItem) {
|
||||
check(recipeItemId, String);
|
||||
check(recipeId, String);
|
||||
check(recipeItemType, String);
|
||||
|
|
@ -37,7 +37,7 @@ Meteor.methods({
|
|||
throw new Meteor.Error('You are not allowed to edit recipe items. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
return RecipeItems.updateAsync({ _id: recipeItemId }, {
|
||||
return await RecipeItems.updateAsync({ _id: recipeItemId }, {
|
||||
$set: {
|
||||
recipeId: recipeId,
|
||||
recipeItemType: recipeItemType,
|
||||
|
|
@ -45,13 +45,13 @@ Meteor.methods({
|
|||
}
|
||||
});
|
||||
},
|
||||
'delete.recipeItem' (recipeItemId) {
|
||||
async 'delete.recipeItem' (recipeItemId) {
|
||||
check(recipeItemId, String);
|
||||
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('You are not allowed to delete recipe items. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
return RecipeItems.removeAsync({ _id: recipeItemId });
|
||||
return await RecipeItems.removeAsync({ _id: recipeItemId });
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue