Revert "feat: only return download url when not found"

This reverts commit 0f3fc7171b.
This commit is contained in:
Methapon Metanipat 2024-08-26 11:09:18 +07:00
parent 0f3fc7171b
commit 798fd4b37b

View file

@ -823,9 +823,7 @@ export class StorageController extends Controller {
});
if (search && search.hits.hits.length === 0) {
return {
downloadUrl: await minioClient.presignedGetObject(DEFAULT_BUCKET, pathname),
};
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบไฟล์");
}
const { attachment, ...rest } = search.hits.hits[0]._source!;