summaryrefslogtreecommitdiff
path: root/app/api/contracts/get-template
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-09-18 00:23:40 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-09-18 00:23:40 +0000
commitcf8dac0c6490469dab88a560004b0c07dbd48612 (patch)
treeb9e76061e80d868331e6b4277deecb9086f845f3 /app/api/contracts/get-template
parente5745fc0268bbb5770bc14a55fd58a0ec30b466e (diff)
(대표님) rfq, 계약, 서명 등
Diffstat (limited to 'app/api/contracts/get-template')
-rw-r--r--app/api/contracts/get-template/route.ts16
1 files changed, 10 insertions, 6 deletions
diff --git a/app/api/contracts/get-template/route.ts b/app/api/contracts/get-template/route.ts
index ff42196f..b7965481 100644
--- a/app/api/contracts/get-template/route.ts
+++ b/app/api/contracts/get-template/route.ts
@@ -12,14 +12,18 @@ export async function POST(request: NextRequest) {
{ status: 400 }
);
}
+
+ // /api/files로 시작하는 경우 제거
+ const cleanPath = templatePath.startsWith('/api/files')
+ ? templatePath.slice('/api/files'.length)
+ : templatePath;
+
const isDev = process.env.NODE_ENV === 'development';
- const fullPath =
- isDev ?
- path.join(process.cwd(), `public`, templatePath)
- :
- path.join(`${process.env.NAS_PATH}`, templatePath);
-
+ const fullPath = isDev
+ ? path.join(process.cwd(), `public`, cleanPath)
+ : path.join(`${process.env.NAS_PATH}`, cleanPath);
+
const fileBuffer = await readFile(fullPath);
return new NextResponse(fileBuffer, {