refactor(server): access checks (#2776)

* refactor(server): access checks

* chore: simply asset module
This commit is contained in:
Jason Rasmussen
2023-06-16 15:01:34 -04:00
committed by GitHub
parent 61d74263d9
commit f04e47803c
11 changed files with 132 additions and 99 deletions
@@ -124,8 +124,8 @@ export class AlbumRepository implements IAlbumRepository {
});
}
async hasAsset(id: string, assetId: string): Promise<boolean> {
const count = await this.repository.count({
hasAsset(id: string, assetId: string): Promise<boolean> {
return this.repository.exist({
where: {
id,
assets: {
@@ -136,8 +136,6 @@ export class AlbumRepository implements IAlbumRepository {
assets: true,
},
});
return Boolean(count);
}
async create(album: Partial<AlbumEntity>): Promise<AlbumEntity> {