Skip to content

Commit

Permalink
refactor: remove deps from Imports model (#34505)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego authored Dec 26, 2024
1 parent 79cba77 commit 403cbfe
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
5 changes: 0 additions & 5 deletions apps/meteor/server/models/raw/Imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { IImportsModel } from '@rocket.chat/model-typings';
import type { Db, Document, FindCursor, FindOptions, UpdateResult, IndexDescription } from 'mongodb';

import { BaseRaw } from './BaseRaw';
import { ensureArray } from '../../../lib/utils/arrayUtils';

export class ImportsModel extends BaseRaw<IImport> implements IImportsModel {
constructor(db: Db) {
Expand Down Expand Up @@ -40,10 +39,6 @@ export class ImportsModel extends BaseRaw<IImport> implements IImportsModel {
return this.updateMany({ valid: { $ne: false }, _id: { $ne: id } }, { $set: { valid: false } });
}

invalidateOperationsNotInStatus(status: IImport['status'] | IImport['status'][]): Promise<UpdateResult | Document> {
return this.updateMany({ valid: { $ne: false }, status: { $nin: ensureArray(status) } }, { $set: { valid: false } });
}

findAllPendingOperations(options: FindOptions<IImport> = {}): FindCursor<IImport> {
return this.find({ valid: true }, options);
}
Expand Down
1 change: 0 additions & 1 deletion packages/model-typings/src/models/IImportsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export interface IImportsModel extends IBaseModel<IImport> {
hasValidOperationInStatus(allowedStatus: IImport['status'][]): Promise<boolean>;
invalidateAllOperations(): Promise<UpdateResult | Document>;
invalidateOperationsExceptId(id: string): Promise<UpdateResult | Document>;
invalidateOperationsNotInStatus(status: string | string[]): Promise<UpdateResult | Document>;
findAllPendingOperations(options: FindOptions<IImport>): FindCursor<IImport>;
increaseTotalCount(id: string, recordType: 'users' | 'channels' | 'messages', increaseBy?: number): Promise<UpdateResult>;
setOperationStatus(id: string, status: IImport['status']): Promise<UpdateResult>;
Expand Down

0 comments on commit 403cbfe

Please sign in to comment.