Fix LastChangedOn property on company images
MODIFY
src/storage/mongodb/CompanyStorage.ts
src/storage/mongodb/CompanyStorage.ts
@@ -194,10 +194,13 @@ export default class CompanyStorage {
$addFields: {
logo: {
$concat: [
- `${Utils.buildRestServerURL()}/client/util/CompanyLogo?ID=`,
+ `${Utils.buildRestServerURL()}/v1/util/companies/`,
{ $toString: '$_id' },
- `&TenantID=${tenant.id}&LastChangedOn=`,
- { $toString: '$lastChangedOn' }
+ '/logo',
+ `?TenantID=${tenant.id}`,
+ {
+ $ifNull: [{ $concat: ['&LastChangedOn=', { $toString: '$lastChangedOn' }] }, ''] // Only concat 'lastChangedOn' if not null
+ }
]
}
}

Fix LastChangedOn property on company images