[MNT-24923] legal hold hold capabilities are not verified properly (#10930)

* [MNT-24923] Added possibility to filter capabilities by person id

* [MNT-24923] Documentation and unit tests
This commit is contained in:
AleksanderSklorz
2025-06-12 14:21:49 +02:00
committed by GitHub
parent 7a568baf72
commit cdc7553915
5 changed files with 67 additions and 12 deletions

View File

@@ -168,16 +168,22 @@ export class FilePlansApi extends BaseApi {
*/
getFilePlanRoles(filePlanId: string, parameters?: FilePlanRoleParameters): Promise<FilePlanRolePaging> {
throwIfNotDefined(filePlanId, 'filePlanId');
const whereConditions: string[] = [];
if (parameters?.where) {
if (parameters.where.personId) {
whereConditions.push(`personId='${parameters.where.personId}'`);
}
if (parameters.where.capabilityNames) {
whereConditions.push(`capabilityName in (${parameters.where.capabilityNames.map((value) => "'" + value + "'").join(', ')})`);
}
}
return this.get({
path: '/file-plans/{filePlanId}/roles',
pathParams: {
filePlanId
},
queryParams: {
where: parameters?.where?.capabilityNames
? `(capabilityName in (${parameters.where.capabilityNames.map((value) => "'" + value + "'").join(', ')}))`
: undefined
where: whereConditions.length ? `(${whereConditions.join(' and ')})` : undefined
}
});
}

View File

@@ -3,6 +3,7 @@
## Properties
| Name | Type |
|---------------------|----------|
| **personId** | string |
| **capabilityNames** | string[] |

View File

@@ -16,5 +16,6 @@
*/
export interface FilePlanRoleParametersWhere {
personId?: string;
capabilityNames?: string[];
}