summaryrefslogtreecommitdiff
path: root/pages/api/po
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-03-26 06:33:14 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-03-26 06:33:14 +0000
commit6f4110be95c83b18e223c8d662d68c675364c74e (patch)
tree4a9a35f185bdbc9d7da2faa905638c25b86caf55 /pages/api/po
parente0dfb55c5457aec489fc084c4567e791b4c65eb1 (diff)
2025.3.26.1533
Diffstat (limited to 'pages/api/po')
-rw-r--r--pages/api/po/webhook.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/pages/api/po/webhook.ts b/pages/api/po/webhook.ts
index 50b3c1f4..e61246a2 100644
--- a/pages/api/po/webhook.ts
+++ b/pages/api/po/webhook.ts
@@ -53,8 +53,6 @@ export default async function handler(
//recipientId === "2" 두번쨰 서명자 서명 완료
const { envelopeId, recipientId } = data;
- console.log(req.body)
-
const contractList = [
{
dbName: "contract_envelopes",
@@ -133,7 +131,7 @@ export default async function handler(
// continue;
// }
- // const fullFilePath = createFolderTree(fileName, filePath);
+ // const fullFilePath = createFolderTree(filePath);
// fs.writeFileSync(fullFilePath, buffer);
}
@@ -229,7 +227,7 @@ export default async function handler(
continue;
}
- const fullFilePath = createFolderTree(fileName, filePath);
+ const fullFilePath = createFolderTree(filePath);
fs.writeFileSync(fullFilePath, buffer);
@@ -296,7 +294,7 @@ export default async function handler(
continue;
}
- const fullFilePath = createFolderTree(fileName, filePath);
+ const fullFilePath = createFolderTree(filePath);
fs.writeFileSync(fullFilePath, buffer);
@@ -324,8 +322,10 @@ export default async function handler(
}
}
-const createFolderTree = (fileName: string, filePath: string): string => {
- const cleanedPath = filePath.replace(/^\/+/, "");
+const createFolderTree = (filePath: string): string => {
+ const fileName = path.basename(filePath);
+ const folderPath = path.dirname(filePath);
+ const cleanedPath = folderPath.replace(/^\/+/, "");
const dirPath = path.resolve(process.cwd(), "public", cleanedPath); // 예: 'contracts/185/signatures'
const fullFilePath = path.join(dirPath, fileName); // 예: 'contracts/185/signatures/xxx.pdf'