fix: share not found if unauthenticated

This commit is contained in:
Elias Schneider
2022-10-14 12:21:26 +02:00
parent 7d8fc72394
commit aa5b125367
3 changed files with 17 additions and 10 deletions

View File

@@ -99,12 +99,19 @@ export class ShareService {
async getSharesByUser(userId: string) {
return await this.prisma.share.findMany({
where: { creator: { id: userId }, expiration: { gt: new Date() } },
where: {
creator: { id: userId },
expiration: { gt: new Date() },
uploadLocked: true,
},
orderBy: {
expiration: "desc",
},
});
}
async get(id: string) {
const share : any = await this.prisma.share.findUnique({
const share: any = await this.prisma.share.findUnique({
where: { id },
include: {
files: true,