Use array for the TagID filter.
MODIFY
src/server/rest/v1/service/UserService.ts
src/server/rest/v1/service/UserService.ts
@@ -1316,7 +1316,7 @@ export default class UserService {
issuer: filteredRequest.Issuer,
siteIDs: (filteredRequest.SiteID ? filteredRequest.SiteID.split('|') : null),
userIDs: (filteredRequest.UserID ? filteredRequest.UserID.split('|') : null),
- tagID: (filteredRequest.TagID ? filteredRequest.TagID : null),
+ tagIDs: (filteredRequest.TagID ? filteredRequest.TagID.split('|') : null),
roles: (filteredRequest.Role ? filteredRequest.Role.split('|') : null),
statuses: (filteredRequest.Status ? filteredRequest.Status.split('|') : null),
excludeSiteID: filteredRequest.ExcludeSiteID,

MODIFY
src/storage/mongodb/UserStorage.ts
src/storage/mongodb/UserStorage.ts
@@ -533,7 +533,7 @@ export default class UserStorage {
includeCarUserIDs?: string[]; excludeUserIDs?: string[]; notAssignedToCarID?: string;
userIDs?: string[]; email?: string; issuer?: boolean; passwordResetHash?: string; roles?: string[];
statuses?: string[]; withImage?: boolean; billingUserID?: string; notSynchronizedBillingData?: boolean;
- notifications?: any; noLoginSince?: Date; tagID?: string;
+ notifications?: any; noLoginSince?: Date; tagIDs?: string[];
},
dbParams: DbParams, projectFields?: string[]): Promise<DataResult<User>> {
// Debug
@@ -642,12 +642,12 @@ export default class UserStorage {
});
}
// Add Tags
- if (params.tagID) {
+ if (params.tagIDs) {
DatabaseUtils.pushTagLookupInAggregation({
tenantID, aggregation, localField: '_id', foreignField: 'userID', asField: 'tag'
});
aggregation.push({
- $match: { 'tag.id': { $eq: params.tagID } }
+ $match: { 'tag.id': { $in: params.tagIDs } }
});
}
// Add Site

Use array for the TagID filter.