feat: only return download url when not found
This commit is contained in:
parent
5e74817f59
commit
0f3fc7171b
1 changed files with 3 additions and 1 deletions
|
|
@ -823,7 +823,9 @@ export class StorageController extends Controller {
|
|||
});
|
||||
|
||||
if (search && search.hits.hits.length === 0) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบไฟล์");
|
||||
return {
|
||||
downloadUrl: await minioClient.presignedGetObject(DEFAULT_BUCKET, pathname),
|
||||
};
|
||||
}
|
||||
|
||||
const { attachment, ...rest } = search.hits.hits[0]._source!;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue