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,24 +12,24 @@ UpdateInfo.allow({
|
|||
});
|
||||
|
||||
Meteor.methods({
|
||||
'add.updateInfo' (updateObject) {
|
||||
async 'add.updateInfo' (updateObject) {
|
||||
check(updateObject, Object);
|
||||
|
||||
return UpdateInfo.insertAsync({
|
||||
return await UpdateInfo.insertAsync({
|
||||
title: updateObject.title,
|
||||
description: updateObject.description,
|
||||
dateRelease: updateObject.date,
|
||||
releaseLink: updateObject.link
|
||||
});
|
||||
},
|
||||
'markUpdate.read' (updateId) {
|
||||
async 'markUpdate.read' (updateId) {
|
||||
check(updateId, String);
|
||||
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('You are not allowed to mark updates as read. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
return UpdateInfo.updateAsync({ _id: updateId }, {
|
||||
return await UpdateInfo.updateAsync({ _id: updateId }, {
|
||||
$set: {
|
||||
viewed: true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue