Skip to content

Commit

Permalink
cr
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman committed Dec 9, 2024
1 parent bab994e commit 19df4e7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const afterRemoveDepartment = async (options: {
});
await Promise.all([
LivechatDepartment.removeDepartmentFromForwardListById(department._id),
...(department.parentId ? [LivechatUnit.removeDepartmentFromUnit(department.parentId)] : []),
...(department.parentId ? [LivechatUnit.decrementDepartmentsCount(department.parentId)] : []),
]);

return options;
Expand Down
11 changes: 0 additions & 11 deletions apps/meteor/ee/server/models/raw/LivechatUnit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,4 @@ export class LivechatUnitRaw extends BaseRaw<IOmnichannelBusinessUnit> implement
countUnits(): Promise<number> {
return this.col.countDocuments({ type: 'u' });
}

removeDepartmentFromUnit(unitId: string): Promise<UpdateResult> {
return this.updateOne(
{
_id: unitId,
},
{
$inc: { numDepartments: -1 },
},
);
}
}
1 change: 0 additions & 1 deletion packages/model-typings/src/models/ILivechatUnitModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ export interface ILivechatUnitModel extends IBaseModel<IOmnichannelBusinessUnit>
findByMonitorId(monitorId: string): Promise<string[]>;
findMonitoredDepartmentsByMonitorId(monitorId: string, includeDisabled: boolean): Promise<ILivechatDepartment[]>;
countUnits(): Promise<number>;
removeDepartmentFromUnit(unitId: string): Promise<UpdateResult>;
}

0 comments on commit 19df4e7

Please sign in to comment.