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 @@ Stores.allow({
|
|||
});
|
||||
|
||||
Meteor.methods({
|
||||
'add.store' (storeName) {
|
||||
async 'add.store' (storeName) {
|
||||
check(storeName, String);
|
||||
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('You are not allowed to add stores. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
return Stores.insertAsync({
|
||||
return await Stores.insertAsync({
|
||||
storeName: storeName,
|
||||
owner: this.userId,
|
||||
});
|
||||
},
|
||||
'edit.store' (storeId, storeName) {
|
||||
async 'edit.store' (storeId, storeName) {
|
||||
check(storeId, String);
|
||||
check(storeName, String);
|
||||
|
||||
|
|
@ -32,19 +32,19 @@ Meteor.methods({
|
|||
throw new Meteor.Error('You are not allowed to edit stores. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
return Stores.updateAsync({ _id: storeId }, {
|
||||
return await Stores.updateAsync({ _id: storeId }, {
|
||||
$set: {
|
||||
storeName: storeName,
|
||||
}
|
||||
});
|
||||
},
|
||||
'delete.store' (storeId) {
|
||||
async 'delete.store' (storeId) {
|
||||
check(storeId, String);
|
||||
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('You are not allowed to delete stores. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
return Stores.removeAsync({ _id: storeId });
|
||||
return await Stores.removeAsync({ _id: storeId });
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue