fix(server): include deleted assets if searching offline assets (#16417)

include deleted assets if searching for offline assets
This commit is contained in:
Mert authored and GitHub committed 2025-02-28 09:23:18 -06:00
1 parent 819e56d9ca
commit b3b15e9b61
1 file changed
+1 -1
+1 -1
View File
@@ -352,7 +352,7 @@ const joinDeduplicationPlugin = new DeduplicateJoinsPlugin();
/** TODO: This should only be used for search-related queries, not as a general purpose query builder */
export function searchAssetBuilder(kysely: Kysely<DB>, options: AssetSearchBuilderOptions) {
options.isArchived ??= options.withArchived ? undefined : false;
options.withDeleted ||= !!(options.trashedAfter || options.trashedBefore);
options.withDeleted ||= !!(options.trashedAfter || options.trashedBefore || options.isOffline);
return kysely
.withPlugin(joinDeduplicationPlugin)
.selectFrom('assets')