tags with only anonymized session can be deleted/reassigned
MODIFY
src/storage/mongodb/UserStorage.ts
src/storage/mongodb/UserStorage.ts
@@ -760,8 +760,10 @@ export default class UserStorage {
}
public static async getTags(tenantID: string,
- params: { issuer?: boolean; tagIDs?: string[]; userIDs?: string[]; dateFrom?: Date; dateTo?: Date;
- withUser?: boolean; withNbrTransactions?: boolean; search?: string, defaultTag?:boolean },
+ params: {
+ issuer?: boolean; tagIDs?: string[]; userIDs?: string[]; dateFrom?: Date; dateTo?: Date;
+ withUser?: boolean; withNbrTransactions?: boolean; search?: string, defaultTag?: boolean
+ },
dbParams: DbParams, projectFields?: string[]): Promise<DataResult<Tag>> {
const uniqueTimerID = Logging.traceStart(MODULE_NAME, 'getTags');
// Check Tenant
@@ -845,7 +847,9 @@ export default class UserStorage {
tenantID, aggregation: aggregation, localField: '_id', foreignField: 'tagID',
count: true, asField: 'transactionsCount', oneToOneCardinality: false,
objectIDFields: ['createdBy', 'lastChangedBy']
- });
+ }, [{
+ '$match': { 'userID': { $exists: true, $ne: null } }
+ }]);
}
// Users
if (params.withUser) {

tags with only anonymized session can be deleted/reassigned