refactor(server, web): create shared link (#2879)

* refactor: shared links

* chore: open api

* fix: tsc error
This commit is contained in:
Jason Rasmussen
2023-06-20 21:08:43 -04:00
committed by GitHub
parent 746ca5d5ed
commit 868f629f32
61 changed files with 2150 additions and 2642 deletions

View File

@@ -18,8 +18,8 @@ export class SharedLinkEntity {
@PrimaryGeneratedColumn('uuid')
id!: string;
@Column({ nullable: true })
description?: string;
@Column({ type: 'varchar', nullable: true })
description!: string | null;
@Column()
userId!: string;
@@ -55,6 +55,9 @@ export class SharedLinkEntity {
@Index('IDX_sharedlink_albumId')
@ManyToOne(() => AlbumEntity, (album) => album.sharedLinks, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })
album?: AlbumEntity;
@Column({ type: 'varchar', nullable: true })
albumId!: string | null;
}
export enum SharedLinkType {

View File

@@ -95,4 +95,13 @@ export class AccessRepository implements IAccessRepository {
}))
);
}
hasAlbumOwnerAccess(userId: string, albumId: string): Promise<boolean> {
return this.albumRepository.exist({
where: {
id: albumId,
ownerId: userId,
},
});
}
}