refactor(server): repositories (#9119)

refactor repos
This commit is contained in:
Daniel Dietzler
2024-04-27 19:52:05 +02:00
committed by GitHub
parent 0b68cc2da6
commit 90882a9b26
5 changed files with 25 additions and 27 deletions
@@ -173,18 +173,18 @@ export class LibraryRepository implements ILibraryRepository {
@GenerateSql({ params: [DummyValue.UUID] })
async getAssetIds(libraryId: string, withDeleted = false): Promise<string[]> {
let query = this.repository
const builder = this.repository
.createQueryBuilder('library')
.innerJoinAndSelect('library.assets', 'assets')
.where('library.id = :id', { id: libraryId })
.select('assets.id');
if (withDeleted) {
query = query.withDeleted();
builder.withDeleted();
}
// Return all asset paths for a given library
const rawResults = await query.getRawMany();
const rawResults = await builder.getRawMany();
const results: string[] = [];