diff --git a/src/controllers/01-branch-controller.ts b/src/controllers/01-branch-controller.ts index b0630f5..4a6b5f7 100644 --- a/src/controllers/01-branch-controller.ts +++ b/src/controllers/01-branch-controller.ts @@ -738,7 +738,7 @@ export class BranchFileController extends Controller { @Path() name: string, ) { await this.checkPermission(req.user, branchId); - return req.res?.redirect(await setFile(fileLocation.branch.attachment(branchId, name))); + return await setFile(fileLocation.branch.attachment(branchId, name)); } @Delete("attachment/{name}") diff --git a/src/controllers/03-customer-branch-controller.ts b/src/controllers/03-customer-branch-controller.ts index ef883c1..1afa7ed 100644 --- a/src/controllers/03-customer-branch-controller.ts +++ b/src/controllers/03-customer-branch-controller.ts @@ -581,7 +581,7 @@ export class CustomerBranchFileController extends Controller { @Path() name: string, ) { await this.checkPermission(req.user, branchId); - return req.res?.redirect(await setFile(fileLocation.customerBranch.attachment(branchId, name))); + return await setFile(fileLocation.customerBranch.attachment(branchId, name)); } @Delete("attachment/{name}") diff --git a/src/controllers/03-employee-controller.ts b/src/controllers/03-employee-controller.ts index 443b09b..794c119 100644 --- a/src/controllers/03-employee-controller.ts +++ b/src/controllers/03-employee-controller.ts @@ -663,7 +663,7 @@ export class EmployeeFileController extends Controller { @Path() name: string, ) { await this.checkPermission(req.user, employeeId); - return req.res?.redirect(await setFile(fileLocation.employee.attachment(employeeId, name))); + return await setFile(fileLocation.employee.attachment(employeeId, name)); } @Delete("attachment/{name}") diff --git a/src/controllers/05-quotation-payment-controller.ts b/src/controllers/05-quotation-payment-controller.ts index a73d140..e45f187 100644 --- a/src/controllers/05-quotation-payment-controller.ts +++ b/src/controllers/05-quotation-payment-controller.ts @@ -141,9 +141,7 @@ export class QuotationPayment extends Controller { ); } - return req.res?.redirect( - await setFile(fileLocation.quotation.payment(quotationId, paymentId, name)), - ); + return await setFile(fileLocation.quotation.payment(quotationId, paymentId, name)); } @Delete("{paymentId}/attachment/{name}")