fix presigned url

This commit is contained in:
2024-10-17 20:58:13 +07:00
parent a9f9861e43
commit 4d908680f0
5 changed files with 80 additions and 31 deletions

View File

@@ -56,14 +56,12 @@ export class ResumeSchema extends PothosSchema {
fileUrl: t.string({
description: 'The URL of the resume file.',
resolve: async (file, args, ctx) => {
const fileUrl = await this.minioService.getFileUrl(
// check if fileUrl is still valid
return await this.minioService.getNewFileUrl(
file.id,
'resumes',
file.fileUrl,
);
if (!fileUrl) {
throw new Error('Cannot retrieve file url');
}
return fileUrl;
},
}),
actualFileName: t.exposeString('actualFileName', {