We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c9551e3 commit 8518721Copy full SHA for 8518721
apps/super-admin/src/pages/SettlementPage/index.tsx
@@ -1,4 +1,5 @@
1
import {
2
+ checkIsHttpError,
3
useAdminCreateSettlementStatement,
4
useAdminSettlementDone,
5
useAdminSettlementEvent,
@@ -100,8 +101,17 @@ const SettlementPage = () => {
100
101
toast.success('정산 내역서를 발송했어요.');
102
dialog.close();
103
} catch (error) {
- console.error(error);
104
- toast.error('정산 내역서를 생성하지 못했어요. 개발자에게 문의해주세요.');
+ 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
115
}
116
}}
117
/>
0 commit comments