From 58cc2aaa141855ac4c1e2c440c2b01ca6f9b8bdf Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Tue, 22 Oct 2024 09:39:30 +0700 Subject: [PATCH] feat: add head method for file endpoint --- src/controllers/05-quotation-payment-controller.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/controllers/05-quotation-payment-controller.ts b/src/controllers/05-quotation-payment-controller.ts index 72843f9..a73d140 100644 --- a/src/controllers/05-quotation-payment-controller.ts +++ b/src/controllers/05-quotation-payment-controller.ts @@ -18,15 +18,7 @@ import prisma from "../db"; import { notFoundError } from "../utils/error"; import HttpError from "../interfaces/http-error"; import HttpStatus from "../interfaces/http-status"; -import { - deleteFile, - fileLocation, - getFile, - getFilePresigned, - listFile, - setFile, -} from "../utils/minio"; -import { RequestWithUser } from "../interfaces/user"; +import { deleteFile, fileLocation, getFile, getPresigned, listFile, setFile } from "../utils/minio"; @Tags("Quotation") @Route("api/v1/quotation/{quotationId}/payment") @@ -111,7 +103,7 @@ export class QuotationPayment extends Controller { @Path() name: string, ) { return req.res?.redirect( - await getFilePresigned("head", fileLocation.quotation.payment(quotationId, paymentId, name)), + await getPresigned("head", fileLocation.quotation.payment(quotationId, paymentId, name)), ); }