|
@@ -161,7 +161,10 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
const res = await disabilityClientManager.get().createAggregatedDisabledPerson.$post({
|
|
const res = await disabilityClientManager.get().createAggregatedDisabledPerson.$post({
|
|
|
json: aggregatedData
|
|
json: aggregatedData
|
|
|
});
|
|
});
|
|
|
- if (res.status !== 200) throw new Error('创建残疾人失败');
|
|
|
|
|
|
|
+ if (res.status !== 200) {
|
|
|
|
|
+ const errorData = await res.json();
|
|
|
|
|
+ throw new Error(errorData.message || '创建残疾人失败');
|
|
|
|
|
+ }
|
|
|
return await res.json();
|
|
return await res.json();
|
|
|
},
|
|
},
|
|
|
onSuccess: () => {
|
|
onSuccess: () => {
|
|
@@ -255,7 +258,10 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
param: { id: data.id! },
|
|
param: { id: data.id! },
|
|
|
json: aggregatedData
|
|
json: aggregatedData
|
|
|
});
|
|
});
|
|
|
- if (res.status !== 200) throw new Error('更新残疾人失败');
|
|
|
|
|
|
|
+ if (res.status !== 200) {
|
|
|
|
|
+ const errorData = await res.json();
|
|
|
|
|
+ throw new Error(errorData.message || '更新残疾人失败');
|
|
|
|
|
+ }
|
|
|
return await res.json();
|
|
return await res.json();
|
|
|
},
|
|
},
|
|
|
onSuccess: () => {
|
|
onSuccess: () => {
|
|
@@ -278,7 +284,10 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
const res = await disabilityClientManager.get().deleteDisabledPerson.$post({
|
|
const res = await disabilityClientManager.get().deleteDisabledPerson.$post({
|
|
|
json: { id }
|
|
json: { id }
|
|
|
});
|
|
});
|
|
|
- if (res.status !== 200) throw new Error('删除残疾人失败');
|
|
|
|
|
|
|
+ if (res.status !== 200) {
|
|
|
|
|
+ const errorData = await res.json();
|
|
|
|
|
+ throw new Error(errorData.message || '删除残疾人失败');
|
|
|
|
|
+ }
|
|
|
return await res.json();
|
|
return await res.json();
|
|
|
},
|
|
},
|
|
|
onSuccess: () => {
|
|
onSuccess: () => {
|
|
@@ -846,7 +855,6 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
label=""
|
|
label=""
|
|
|
required={true}
|
|
required={true}
|
|
|
control={createForm.control}
|
|
control={createForm.control}
|
|
|
- setValue={createForm.setValue}
|
|
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
<FormField
|
|
<FormField
|
|
@@ -1211,7 +1219,6 @@ const DisabilityPersonManagement: React.FC = () => {
|
|
|
label=""
|
|
label=""
|
|
|
required={true}
|
|
required={true}
|
|
|
control={updateForm.control}
|
|
control={updateForm.control}
|
|
|
- setValue={updateForm.setValue}
|
|
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
<FormField
|
|
<FormField
|