Skip to content

Commit 8518721

Browse files
committed
feat: 슈퍼 어드민에서 정산 내역서 중복 전송 시, 에러 메시지가 출력되도록 수정
1 parent c9551e3 commit 8518721

File tree

1 file changed

+12
-2
lines changed
  • apps/super-admin/src/pages/SettlementPage

1 file changed

+12
-2
lines changed

apps/super-admin/src/pages/SettlementPage/index.tsx

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
checkIsHttpError,
23
useAdminCreateSettlementStatement,
34
useAdminSettlementDone,
45
useAdminSettlementEvent,
@@ -100,8 +101,17 @@ const SettlementPage = () => {
100101
toast.success('정산 내역서를 발송했어요.');
101102
dialog.close();
102103
} catch (error) {
103-
console.error(error);
104-
toast.error('정산 내역서를 생성하지 못했어요. 개발자에게 문의해주세요.');
104+
if (error instanceof Error && checkIsHttpError(error)) {
105+
const json: {
106+
type: string; detail: string
107+
} = await error.response.json();
108+
109+
if (json.type === 'SETTLEMENT_STATEMENT_CREATION_ALREADY_IN_PROGRESS') {
110+
toast.error(json.detail)
111+
} else {
112+
toast.error('정산 내역서를 생성하지 못했어요. 개발자에게 문의해주세요.');
113+
}
114+
}
105115
}
106116
}}
107117
/>

0 commit comments

Comments
 (0)