mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
chore: awesome
This commit is contained in:
15
src/view/model/SyncCustom/index.tsx
vendored
15
src/view/model/SyncCustom/index.tsx
vendored
@@ -96,13 +96,16 @@ export default function SyncCustom() {
|
||||
const handleOk = () => {
|
||||
formRef.current?.form?.validateFields()
|
||||
.then((vals: Record<string, any>) => {
|
||||
let data = [];
|
||||
switch (opInfo.opType) {
|
||||
case 'new': data = opAdd(vals); break;
|
||||
case 'edit': data = opReplace(opInfo?.opRecord?.[opSafeKey], vals); break;
|
||||
default: break;
|
||||
if (opInfo.opType === 'new') {
|
||||
const data = opAdd(vals);
|
||||
modelSet(data);
|
||||
message.success('Data added successfully');
|
||||
}
|
||||
if (opInfo.opType === 'edit') {
|
||||
const data = opReplace(opInfo?.opRecord?.[opSafeKey], vals);
|
||||
modelSet(data);
|
||||
message.success('Data updated successfully');
|
||||
}
|
||||
modelSet(data);
|
||||
hide();
|
||||
})
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user