-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Business Units endpoints not filtering by Unit type (#26713)
Co-authored-by: murtaza98 <murtaza.patrawala@rocket.chat>
- Loading branch information
Showing
6 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
import type { ILivechatUnitModel } from '@rocket.chat/model-typings'; | ||
import type { IOmnichannelBusinessUnit } from '@rocket.chat/core-typings'; | ||
import type { FindPaginated, ILivechatUnitModel } from '@rocket.chat/model-typings'; | ||
import type { FindOptions, Filter, FindCursor } from 'mongodb'; | ||
|
||
import { LivechatDepartmentRaw } from '../../../../server/models/raw/LivechatDepartment'; | ||
|
||
export class LivechatUnitRaw extends LivechatDepartmentRaw implements ILivechatUnitModel {} | ||
export class LivechatUnitRaw extends LivechatDepartmentRaw implements ILivechatUnitModel { | ||
findPaginatedUnits( | ||
query: Filter<IOmnichannelBusinessUnit>, | ||
options?: FindOptions<IOmnichannelBusinessUnit>, | ||
): FindPaginated<FindCursor<IOmnichannelBusinessUnit>> { | ||
// @ts-expect-error - This extend from LivechatDepartment messes up with the types | ||
return super.findPaginated({ ...query, type: 'u' }, options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
import type { IOmnichannelBusinessUnit } from '@rocket.chat/core-typings'; | ||
import type { FindOptions, Filter, FindCursor } from 'mongodb'; | ||
|
||
import type { FindPaginated } from './IBaseModel'; | ||
import type { ILivechatDepartmentModel } from './ILivechatDepartmentModel'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface ILivechatUnitModel extends ILivechatDepartmentModel { | ||
// | ||
findPaginatedUnits( | ||
query: Filter<IOmnichannelBusinessUnit>, | ||
options?: FindOptions<IOmnichannelBusinessUnit>, | ||
): FindPaginated<FindCursor<IOmnichannelBusinessUnit>>; | ||
} |