refactor: use # instead of private

This commit is contained in:
Methapon2001 2025-01-10 10:19:40 +07:00
parent 5cf5e079fb
commit a416f7d04e

View file

@ -1036,7 +1036,7 @@ export class QuotationActionController extends Controller {
@Route("api/v1/quotation/{quotationId}/attachment") @Route("api/v1/quotation/{quotationId}/attachment")
@Tags("Quotation") @Tags("Quotation")
export class QuotationFileController extends Controller { export class QuotationFileController extends Controller {
private async checkPermission(user: RequestWithUser["user"], id: string) { async #checkPermission(user: RequestWithUser["user"], id: string) {
const data = await prisma.quotation.findUnique({ const data = await prisma.quotation.findUnique({
include: { include: {
registeredBranch: { registeredBranch: {
@ -1052,7 +1052,7 @@ export class QuotationFileController extends Controller {
@Get() @Get()
@Security("keycloak") @Security("keycloak")
async listAttachment(@Request() req: RequestWithUser, @Path() quotationId: string) { async listAttachment(@Request() req: RequestWithUser, @Path() quotationId: string) {
await this.checkPermission(req.user, quotationId); await this.#checkPermission(req.user, quotationId);
return await listFile(fileLocation.quotation.attachment(quotationId)); return await listFile(fileLocation.quotation.attachment(quotationId));
} }
@ -1074,7 +1074,7 @@ export class QuotationFileController extends Controller {
@Path() quotationId: string, @Path() quotationId: string,
@Path() name: string, @Path() name: string,
) { ) {
await this.checkPermission(req.user, quotationId); await this.#checkPermission(req.user, quotationId);
return await getFile(fileLocation.quotation.attachment(quotationId, name)); return await getFile(fileLocation.quotation.attachment(quotationId, name));
} }
@ -1085,7 +1085,7 @@ export class QuotationFileController extends Controller {
@Path() quotationId: string, @Path() quotationId: string,
@Path() name: string, @Path() name: string,
) { ) {
await this.checkPermission(req.user, quotationId); await this.#checkPermission(req.user, quotationId);
return await setFile(fileLocation.quotation.attachment(quotationId, name)); return await setFile(fileLocation.quotation.attachment(quotationId, name));
} }
@ -1096,7 +1096,7 @@ export class QuotationFileController extends Controller {
@Path() quotationId: string, @Path() quotationId: string,
@Path() name: string, @Path() name: string,
) { ) {
await this.checkPermission(req.user, quotationId); await this.#checkPermission(req.user, quotationId);
return await deleteFile(fileLocation.quotation.attachment(quotationId, name)); return await deleteFile(fileLocation.quotation.attachment(quotationId, name));
} }
} }