fix wrong logic uploaded file

This commit is contained in:
2024-11-09 15:49:06 +07:00
parent 797018ed74
commit 2736547b84
6 changed files with 23 additions and 44 deletions

View File

@@ -46,7 +46,7 @@ export class UploadedFileSchema extends PothosSchema {
description: 'The URL of the file.',
resolve: async (file) => {
return await this.minioService.updatePresignUrl(
file.id,
file.fileName,
'files',
file.fileUrl,
)
@@ -89,7 +89,10 @@ export class UploadedFileSchema extends PothosSchema {
if (!file) {
throw new Error('File not found')
}
const fileUrl = await this.minioService.getFileUrl(file.id, 'files')
const fileUrl = await this.minioService.getFileUrl(
file.fileName,
'files',
)
if (!fileUrl) {
throw new Error('Cannot retrieve file url')
}