feat: direct file link

This commit is contained in:
Elias Schneider
2023-01-31 15:22:08 +01:00
parent cd9d828686
commit 008df06b5c
11 changed files with 144 additions and 25 deletions

View File

@@ -204,12 +204,13 @@ export class ShareService {
return sharesWithEmailRecipients;
}
async get(id: string) {
async get(id: string): Promise<any> {
const share = await this.prisma.share.findUnique({
where: { id },
include: {
files: true,
creator: true,
security: true,
},
});
@@ -218,8 +219,10 @@ export class ShareService {
if (!share || !share.uploadLocked)
throw new NotFoundException("Share not found");
return share as any;
return {
...share,
hasPassword: share.security?.password ? true : false,
};
}
async getMetaData(id: string) {