Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman authored Oct 14, 2024
1 parent a0e985d commit 9fac813
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { notifyOnSubscriptionChanged, notifyOnRoomChangedById } from '../../../l

export const provideUsersSuggestedGroupKeys = async (
userId: IUser['_id'],
usersSuggestedGroupKeys: Record<IRoom['_id'], { _id: IUser['_id']; key: string; oldKeys: ISubscription['oldRoomKeys'] }[]>,
usersSuggestedGroupKeys: Record<IRoom['_id'], { _id: IUser['_id']; key: string; oldKeys?: ISubscription['oldRoomKeys'] }[]>,
) => {
const roomIds = Object.keys(usersSuggestedGroupKeys);

Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/server/models/raw/Subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ export class SubscriptionsRaw extends BaseRaw<ISubscription> implements ISubscri
return this.updateMany(query, update);
}

async setGroupE2EKeyAndOldRoomKeys(_id: string, key: string, oldRoomKeys: ISubscription['oldRoomKeys']): Promise<UpdateResult> {
async setGroupE2EKeyAndOldRoomKeys(_id: string, key: string, oldRoomKeys?: ISubscription['oldRoomKeys']): Promise<UpdateResult> {
const query = { _id };
const update = { $set: { E2EKey: key, ...(oldRoomKeys && { oldRoomKeys }) } };
return this.updateOne(query, update);
Expand Down Expand Up @@ -609,7 +609,7 @@ export class SubscriptionsRaw extends BaseRaw<ISubscription> implements ISubscri
uid: string,
rid: string,
key: string,
suggestedOldRoomKeys: ISubscription['suggestedOldRoomKeys'],
suggestedOldRoomKeys?: ISubscription['suggestedOldRoomKeys'],
): Promise<ModifyResult<ISubscription>> {
const query = { rid, 'u._id': uid };
const update = { $set: { E2ESuggestedKey: key, ...(suggestedOldRoomKeys && { suggestedOldRoomKeys }) } };
Expand Down

0 comments on commit 9fac813

Please sign in to comment.