Skip to content

Commit

Permalink
🐛 fixed some missing async methods (Extensions)
Browse files Browse the repository at this point in the history
  • Loading branch information
faburem committed Jul 26, 2024
1 parent 0cde450 commit f4769ec
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions imports/api/extensions/server/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const addExtension = new ValidatedMethod({
}
const existingExtension = await Extensions.findOneAsync({ name: newExtension.name })
if (!existingExtension) {
Extensions.insert(newExtension)
await Extensions.insertAsync(newExtension)
return 'notifications.success'
}
throw new Meteor.Error('Extension has been added before.')
Expand All @@ -68,7 +68,7 @@ const removeExtension = new ValidatedMethod({
async run({ extensionId }) {
const extension = await Extensions.findOneAsync({ _id: extensionId })
if (extension) {
Extensions.remove({ _id: extension._id })
await Extensions.removeAsync({ _id: extension._id })
return 'notifications.success'
}
return new Meteor.Error('Extension does not exist.')
Expand Down
2 changes: 1 addition & 1 deletion imports/api/globalsettings/server/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const resetGlobalsetting = new ValidatedMethod({
},
mixins: [adminAuthenticationMixin, transactionLogMixin],
async run({ name }) {
Globalsettings.remove({ name })
await Globalsettings.removeAsync({ name })
for (const setting of defaultSettings) {
if (setting.name === name) {
// eslint-disable-next-line no-await-in-loop
Expand Down
4 changes: 2 additions & 2 deletions imports/api/notifications/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ async function addNotification(message, userId) {
recipient = meteorUser.emails[0].address
await Notifications.removeAsync({ userId })
await Notifications.insertAsync({ _id: id, userId, message })
Meteor.setTimeout(() => {
Notifications.remove({ _id: id })
Meteor.setTimeout(async () => {
await Notifications.removeAsync({ _id: id })
}, 60000)
} else {
recipient = userId
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "titra",
"version": "0.99.2",
"version": "0.99.3",
"private": true,
"scripts": {
"start": "meteor run"
Expand Down

0 comments on commit f4769ec

Please sign in to comment.