mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-04-06 21:40:23 +08:00
fix(EventWidget): fix the parameters init problem
This commit is contained in:
parent
3f76911745
commit
3b4c2e038c
@ -95,10 +95,13 @@ export const EventWidget: React.FC<WidgetProps<EventWidgetOptionsType>> = observ
|
||||
const spec = paramsSpec!.properties![key] as TSchema;
|
||||
const defaultValue = spec.defaultValue;
|
||||
|
||||
params[key] = defaultValue ?? parseTypeBox(spec);
|
||||
params[key] =
|
||||
formik.values.method.parameters?.[key] ?? defaultValue ?? parseTypeBox(spec);
|
||||
}
|
||||
|
||||
return params;
|
||||
// only update when params spec change
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [paramsSpec]);
|
||||
const parametersPath = useMemo(() => path.concat('method', 'parameters'), [path]);
|
||||
const parametersSpec = useMemo(
|
||||
|
Loading…
x
Reference in New Issue
Block a user