Fixed no file error

This commit is contained in:
Vins 2024-02-16 16:00:07 +01:00
parent 5be70cff2e
commit 42c72713fb

View File

@ -32,12 +32,13 @@ export default class BucketController extends ApiController {
const fileName = office.rib_name;
if(!fileName) {
this.httpNotFoundRequest(response, "No file found");
return;
}
try {
const file = await this.bucketService.getByUid(uid, fileName);
response.attachment(fileName);
const file = await this.bucketService.getByUid(uid, fileName!);
response.attachment(fileName!);
response.send(file.Body);
} catch (error) {
this.httpInternalError(response, error);