From 1a804610bd0a766b4837f5e3a9ccb6d6c6b9cdeb Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Mon, 9 Sep 2024 15:46:48 +0700 Subject: [PATCH] fix: wrong position --- src/controllers/01-branch-controller.ts | 2 +- src/utils/minio.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/01-branch-controller.ts b/src/controllers/01-branch-controller.ts index 0817826..20e5b36 100644 --- a/src/controllers/01-branch-controller.ts +++ b/src/controllers/01-branch-controller.ts @@ -814,7 +814,7 @@ export class BranchController extends Controller { throw new HttpError(HttpStatus.NOT_FOUND, "Branch cannot be found.", "branchNotFound"); } - return await listFile(fileLocation.user.profile(branchId)); + return await listFile(fileLocation.branch.img(branchId)); } @Get("{branchId}/image/{name}") diff --git a/src/utils/minio.ts b/src/utils/minio.ts index a62a6b0..7fccef3 100644 --- a/src/utils/minio.ts +++ b/src/utils/minio.ts @@ -44,7 +44,7 @@ export const fileLocation = { image: (branchId: string) => `branch/branch-img-${branchId}`, map: (branchId: string) => `branch/map-img-${branchId}`, bank: (branchId: string, bankId: string) => `branch/bank-qr-${branchId}-${bankId}`, - img: (branchId: string, name?: string) => `user/img-${branchId}/${name || ""}`, + img: (branchId: string, name?: string) => `branch/img-${branchId}/${name || ""}`, }, user: { profile: (userId: string, name?: string) => `user/profile-image-${userId}/${name || ""}`,