Fix formatting

This commit is contained in:
Pawel Wojtaszko 2025-08-06 00:31:21 +02:00 committed by mertalev
parent 3c3a1bb1a5
commit ce10c27d7a
No known key found for this signature in database
GPG key ID: DF6ABC77AAD98C95
2 changed files with 18 additions and 11 deletions

View file

@ -691,16 +691,19 @@ export class AssetRepository {
eb.fn.coalesce(eb.fn('array_agg', ['duration']), sql.lit('{}')).as('duration'),
eb.fn.coalesce(eb.fn('array_agg', ['id']), sql.lit('{}')).as('id'),
eb.fn.coalesce(eb.fn('array_agg', ['visibility']), sql.lit('{}')).as('visibility'),
eb.fn.coalesce(
eb.fn('array_agg', [
eb.case()
.when(eb.ref('ownerId'), '=', auth?.user.id || '')
.then(eb.ref('isFavorite'))
.else(sql.lit(false))
.end()
]),
sql.lit('{}')
).as('isFavorite'),
eb.fn
.coalesce(
eb.fn('array_agg', [
eb
.case()
.when(eb.ref('ownerId'), '=', auth?.user.id || '')
.then(eb.ref('isFavorite'))
.else(sql.lit(false))
.end(),
]),
sql.lit('{}'),
)
.as('isFavorite'),
eb.fn.coalesce(eb.fn('array_agg', ['isImage']), sql.lit('{}')).as('isImage'),
// TODO: isTrashed is redundant as it will always be all true or false depending on the options
eb.fn.coalesce(eb.fn('array_agg', ['isTrashed']), sql.lit('{}')).as('isTrashed'),

View file

@ -162,7 +162,11 @@ export class NotificationService extends BaseService {
const [asset] = await this.assetRepository.getByIdsWithAllRelationsButStacks([assetId]);
if (asset) {
this.eventRepository.clientSend('on_asset_update', userId, mapAsset(asset, { auth: { user: { id: userId } } as AuthDto }));
this.eventRepository.clientSend(
'on_asset_update',
userId,
mapAsset(asset, { auth: { user: { id: userId } } as AuthDto }),
);
}
}