fix(server): empty trash skips offline external library assets

This commit is contained in:
timonrieger
2026-06-12 17:15:14 +02:00
parent 50f1121459
commit 0d45aa76e1
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -15,7 +15,8 @@ set
"status" = $1
where
"ownerId" = $2
and "status" = $3
and "deletedAt" is not null
and "status" != $3
-- TrashRepository.restoreAll
update "asset"
+2 -1
View File
@@ -28,7 +28,8 @@ export class TrashRepository {
const { numUpdatedRows } = await this.db
.updateTable('asset')
.where('ownerId', '=', userId)
.where('status', '=', AssetStatus.Trashed)
.where('deletedAt', 'is not', null)
.where('status', '!=', AssetStatus.Deleted)
.set({ status: AssetStatus.Deleted })
.executeTakeFirst();