feat: add security to endpoint

This commit is contained in:
Methapon Metanipat 2024-11-01 17:34:36 +07:00
parent 8feca848f2
commit 1a31a29680
2 changed files with 2 additions and 2 deletions

View file

@ -231,7 +231,6 @@ export class PaymentFileController extends Controller {
}
@Get("{name}")
@Security("keycloak")
async getAttachment(
@Request() req: RequestWithUser,
@Path() paymentId: string,

View file

@ -842,13 +842,14 @@ export class QuotationFileController extends Controller {
}
@Get("{name}")
@Security("keycloak")
async getAttachment(
@Request() req: RequestWithUser,
@Path() quotationId: string,
@Path() name: string,
) {
await this.checkPermission(req.user, quotationId);
return req.res?.redirect(await getFile(fileLocation.quotation.attachment(quotationId, name)));
return await getFile(fileLocation.quotation.attachment(quotationId, name));
}
@Put("{name}")