fix(R56): 修复费用标准编辑时 expenseTypeId 校验失败
前端编辑提交时携带了只读字段 expenseTypeId,后端 strict schema 拒绝。 剔除只读字段后 PATCH 正常工作。
这个提交包含在:
@@ -140,8 +140,7 @@ export function ExpenseStandardsPage() {
|
||||
|
||||
const saveMutation = useMutation({
|
||||
mutationFn: async () => {
|
||||
const payload = {
|
||||
expenseTypeId: form.expenseTypeId,
|
||||
const mutablePayload = {
|
||||
name: form.name.trim(),
|
||||
maxAmount: form.maxAmount.trim(),
|
||||
perUnit: form.perUnit,
|
||||
@@ -153,10 +152,13 @@ export function ExpenseStandardsPage() {
|
||||
};
|
||||
|
||||
if (editingItem) {
|
||||
return updateExpenseStandard(editingItem.id, payload);
|
||||
return updateExpenseStandard(editingItem.id, mutablePayload);
|
||||
}
|
||||
|
||||
return createExpenseStandard(payload);
|
||||
return createExpenseStandard({
|
||||
expenseTypeId: form.expenseTypeId,
|
||||
...mutablePayload,
|
||||
});
|
||||
},
|
||||
onSuccess: async () => {
|
||||
await queryClient.invalidateQueries({ queryKey: ["expense-standards"] });
|
||||
|
||||
在新工单中引用
屏蔽一个用户