RemarkForm 的 onSave 回调之前只传 user_id 和 remark, 导致后端用零值覆盖邀请人、余额、佣金等字段。 参考 enable 开关的模式,排除不兼容字段后展开 ...rest, 保证 updateUserBasicInfo 收到完整的用户数据。 Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -329,10 +329,20 @@ export default function User() {
|
|||||||
CloseComponent={PopoverClose}
|
CloseComponent={PopoverClose}
|
||||||
onSave={async (remark) => {
|
onSave={async (remark) => {
|
||||||
const {
|
const {
|
||||||
|
auth_methods: _auth_methods,
|
||||||
|
user_devices: _user_devices,
|
||||||
|
enable_balance_notify: _enable_balance_notify,
|
||||||
|
enable_login_notify: _enable_login_notify,
|
||||||
|
enable_subscribe_notify: _enable_subscribe_notify,
|
||||||
|
enable_trade_notify: _enable_trade_notify,
|
||||||
|
updated_at: _updated_at,
|
||||||
|
created_at: _created_at,
|
||||||
id,
|
id,
|
||||||
|
...rest
|
||||||
} = row.original;
|
} = row.original;
|
||||||
await updateUserBasicInfo({
|
await updateUserBasicInfo({
|
||||||
user_id: id,
|
user_id: id,
|
||||||
|
...rest,
|
||||||
remark,
|
remark,
|
||||||
} as unknown as API.UpdateUserBasiceInfoRequest);
|
} as unknown as API.UpdateUserBasiceInfoRequest);
|
||||||
toast.success(t('updateSuccess'));
|
toast.success(t('updateSuccess'));
|
||||||
|
|||||||
Reference in New Issue
Block a user