diff --git a/apps/st/src/components/statistics/management/NoticeTalkSending.tsx b/apps/st/src/components/statistics/management/NoticeTalkSending.tsx index ff5031193..6ead463fb 100644 --- a/apps/st/src/components/statistics/management/NoticeTalkSending.tsx +++ b/apps/st/src/components/statistics/management/NoticeTalkSending.tsx @@ -2,6 +2,7 @@ import { useMemo, useState } from "react"; +import { useConfirm } from "@frontend-opensource/use-react-hooks"; import { useQuery } from "@tanstack/react-query"; import { type ColumnDef, @@ -129,6 +130,7 @@ function getMergedVariables( function NtitlkSndng() { const alert = useAlertStore((state) => state.setMessage); + const { confirm } = useConfirm(); const [searchStatsYr, setSearchStatsYr] = useState(getDefaultStatsYear()); const [searchSido, setSearchSido] = useState(""); @@ -444,10 +446,6 @@ function NtitlkSndng() { alert("알림톡 템플릿을 선택해주세요."); return; } - if (selectedRecipients.length === 0) { - alert("발송할 담당자를 1명 이상 선택해주세요."); - return; - } const missingVariable = selectedRecipients.some((recipient) => variableNames.some((name) => { @@ -462,6 +460,12 @@ function NtitlkSndng() { alert("필수 변수값이 입력되지 않은 발송 대상이 있습니다."); return; } + if ( + !(await confirm( + `${selectedRecipients.length}명에게 발송하시겠습니까?`, + )) + ) + return; const payload: BusinessSendRequest = { templateCode: selectedTemplateCode, @@ -483,10 +487,7 @@ function NtitlkSndng() { return; } - alert( - data.message || - `${data.sentCount}건의 알림톡 발송이 요청되었습니다.`, - ); + alert(data.message || `알림톡 발송이 요청되었습니다.`); setSelectedRecipients([]); setCommonVariableValues({}); } catch { @@ -675,6 +676,7 @@ function NtitlkSndng() {

@@ -711,29 +712,8 @@ function NtitlkSndng() { {variableNames.length > 0 && ( -
-
-

- 변수 일괄 적용 -

-
- - -
-
+
+

변수 일괄 적용

{variableNames.map((variableName) => (
@@ -806,6 +786,21 @@ function NtitlkSndng() { )}
))} +
+ + +
)} @@ -816,9 +811,9 @@ function NtitlkSndng() { 선택된 발송 대상이 없습니다.

) : ( -
+
- + 이름 @@ -826,15 +821,6 @@ function NtitlkSndng() { 전화번호 - {/* - 시도 - - - 시군구 - - - 소속 - */} {variableNames.map((variableName) => ( ))} - 액션 + 버튼 @@ -859,15 +845,6 @@ function NtitlkSndng() { {recipient.telNo} - {/* - {recipient.sido} - - - {recipient.gugun} - - - {recipient.deptNm} - */} {variableNames.map( (variableName) => ( -
+