Skip to content

Commit

Permalink
chore: removed unnecessary async/await
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandernsilva authored and tassoevan committed Nov 25, 2024
1 parent 7996488 commit 8a37af4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/meteor/client/hooks/useHideRoomAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const useHideRoomAction = ({ rid: roomId, type, name }: HideRoomProps, {

if (userId && rollbackDocument) {
const { alert, open } = rollbackDocument;
await updateSubscription(roomId, userId, { alert, open });
updateSubscription(roomId, userId, { alert, open });
}
},
});
Expand Down
6 changes: 3 additions & 3 deletions apps/meteor/client/lib/mutationEffects/updateSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import type { ISubscription } from '@rocket.chat/core-typings';

import { Subscriptions } from '../../../app/models/client';

export const updateSubscription = async (roomId: string, userId: string, data: Partial<ISubscription>) => {
const oldDocument = await Subscriptions.findOne({ 'rid': roomId, 'u._id': userId });
export const updateSubscription = (roomId: string, userId: string, data: Partial<ISubscription>) => {
const oldDocument = Subscriptions.findOne({ 'rid': roomId, 'u._id': userId });

await Subscriptions.update({ 'rid': roomId, 'u._id': userId }, { $set: data });
Subscriptions.update({ 'rid': roomId, 'u._id': userId }, { $set: data });

return oldDocument;
};

0 comments on commit 8a37af4

Please sign in to comment.