dev
This commit is contained in:
@@ -34,11 +34,13 @@ export const getInviteConfig = () =>
|
||||
|
||||
// 更新邀请活动配置
|
||||
export const updateInviteConfig = (data: {
|
||||
firstOrderRate?: number;
|
||||
secondOrderRate?: number;
|
||||
minCashback?: number;
|
||||
maxCashback?: number;
|
||||
withdrawThreshold?: number;
|
||||
config?: {
|
||||
firstOrderRate?: number;
|
||||
secondOrderRate?: number;
|
||||
minCashback?: number;
|
||||
maxCashback?: number;
|
||||
withdrawThreshold?: number;
|
||||
};
|
||||
enabled?: boolean;
|
||||
}) =>
|
||||
request.put('/admin/activity/invite/config', data);
|
||||
@@ -77,8 +77,8 @@ const InviteManage: React.FC = () => {
|
||||
try {
|
||||
const res = await getInviteConfig();
|
||||
setConfig(res.data);
|
||||
if (res.data) {
|
||||
form.setFieldsValue(res.data);
|
||||
if (res.data?.config) {
|
||||
form.setFieldsValue(res.data.config);
|
||||
}
|
||||
} finally {
|
||||
setConfigLoading(false);
|
||||
@@ -121,9 +121,9 @@ const InviteManage: React.FC = () => {
|
||||
const handleSaveConfig = async () => {
|
||||
try {
|
||||
const values = await form.validateFields();
|
||||
await updateInviteConfig(values);
|
||||
await updateInviteConfig({ config: values });
|
||||
message.success('配置已保存');
|
||||
setConfig({ ...config, ...values });
|
||||
setConfig({ ...config, config: { ...config?.config, ...values } });
|
||||
} catch {}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user