minor renamery
This commit is contained in:
@@ -53,7 +53,7 @@ export class AlbumEntity {
|
|||||||
@Column({ comment: 'Asset ID to be used as thumbnail', nullable: true })
|
@Column({ comment: 'Asset ID to be used as thumbnail', nullable: true })
|
||||||
albumThumbnailAssetId!: string | null;
|
albumThumbnailAssetId!: string | null;
|
||||||
|
|
||||||
@OneToMany(() => AlbumUserEntity, (permission) => permission.album)
|
@OneToMany(() => AlbumUserEntity, ({ album }) => album)
|
||||||
albumUsers!: AlbumUserEntity[];
|
albumUsers!: AlbumUserEntity[];
|
||||||
|
|
||||||
@ManyToMany(() => AssetEntity, (asset) => asset.albums)
|
@ManyToMany(() => AssetEntity, (asset) => asset.albums)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export type AlbumPermissionId = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export interface IAlbumUserRepository {
|
export interface IAlbumUserRepository {
|
||||||
create(albumPermission: Partial<AlbumUserEntity>): Promise<AlbumUserEntity>;
|
create(albumUser: Partial<AlbumUserEntity>): Promise<AlbumUserEntity>;
|
||||||
update({ userId, albumId }: AlbumPermissionId, albumPermission: Partial<AlbumUserEntity>): Promise<AlbumUserEntity>;
|
update({ userId, albumId }: AlbumPermissionId, albumPermission: Partial<AlbumUserEntity>): Promise<AlbumUserEntity>;
|
||||||
delete({ userId, albumId }: AlbumPermissionId): Promise<void>;
|
delete({ userId, albumId }: AlbumPermissionId): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import { Repository } from 'typeorm';
|
|||||||
export class AlbumUserRepository implements IAlbumUserRepository {
|
export class AlbumUserRepository implements IAlbumUserRepository {
|
||||||
constructor(@InjectRepository(AlbumUserEntity) private repository: Repository<AlbumUserEntity>) {}
|
constructor(@InjectRepository(AlbumUserEntity) private repository: Repository<AlbumUserEntity>) {}
|
||||||
|
|
||||||
async create(dto: Partial<AlbumUserEntity>): Promise<AlbumUserEntity> {
|
async create(albumUser: Partial<AlbumUserEntity>): Promise<AlbumUserEntity> {
|
||||||
const { userId, albumId } = await this.repository.save(dto);
|
const { userId, albumId } = await this.repository.save(albumUser);
|
||||||
return this.repository.findOneOrFail({ where: { userId, albumId } });
|
return this.repository.findOneOrFail({ where: { userId, albumId } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
dispatch('refreshAlbum');
|
dispatch('refreshAlbum');
|
||||||
notificationController.show({ type: NotificationType.Info, message });
|
notificationController.show({ type: NotificationType.Info, message });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, 'Unable to set permission');
|
handleError(error, 'Unable to set user role');
|
||||||
} finally {
|
} finally {
|
||||||
selectedRemoveUser = null;
|
selectedRemoveUser = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user