From 86b626b5ea17b682784a8a7ca671273393012b36 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Thu, 6 Aug 2026 14:55:27 +0900 Subject: [PATCH] =?UTF-8?q?260806=5F01=5FENH:=20=EC=9D=B4=EB=A9=94?= =?UTF-8?q?=EC=9D=BC=20=EC=B2=A8=EB=B6=80=ED=8C=8C=EC=9D=BC=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/message-template/[[...slug]]/route.ts | 25 ++- src/components/dialog/MessageSendDialog.tsx | 30 ++- .../dialog/SingleMessageSendDialog.tsx | 17 +- .../message-template/MessageTemplate.tsx | 191 +++++++++++++++++- .../TemplateAttachmentList.tsx | 53 +++++ src/const/messageTemplateConst.ts | 4 + src/query/message.ts | 34 +++- src/types/message.ts | 9 + 8 files changed, 336 insertions(+), 27 deletions(-) create mode 100644 src/components/message-template/TemplateAttachmentList.tsx diff --git a/src/app/api/message-template/[[...slug]]/route.ts b/src/app/api/message-template/[[...slug]]/route.ts index 621dff8..bd542d0 100644 --- a/src/app/api/message-template/[[...slug]]/route.ts +++ b/src/app/api/message-template/[[...slug]]/route.ts @@ -11,6 +11,19 @@ export const GET = async (req: NextRequest, context: RouteContext) => { const [action] = slug; const notihubApi = await createNotihubApi(); + if(slug.length === 2 && slug[1] === "attachment"){ + const fileName = searchParams.get("fileName"); + if (!fileName) { + return NextResponse.json({ message: "fileName은 필수입니다." }, { status: 400 }); + } + + const result = await notihubApi.get( + `/template/${slug[0]}/attachment?fileName=${encodeURIComponent(fileName)}`, + { expectBinary: true }, + ); + return new NextResponse(result, { status: 200, headers: { "Content-Type": "application/octet-stream" } }); + } + if(slug.length === 1){ const result = await notihubApi.get