Skip to content

Commit 6662ba4

Browse files
authored
Merge pull request #154 from workfloworchestrator/2067-small-fixes
2067 small fixes
2 parents 84bfad4 + 1acbbb6 commit 6662ba4

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'pydantic-forms': patch
3+
---
4+
5+
Removes double function call

frontend/packages/pydantic-forms/src/core/PydanticFormContextProvider.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,9 @@ function PydanticFormContextProvider({
210210

211211
const resetFormData = useCallback(
212212
(inputData: object = {}) => {
213-
if (!pydanticFormSchema) {
214-
return;
215-
}
216-
217213
rhf.reset(inputData);
218214
},
219-
[pydanticFormSchema, rhf],
215+
[rhf],
220216
);
221217

222218
rhfRef.current = rhf;
@@ -291,15 +287,6 @@ function PydanticFormContextProvider({
291287
setErrorDetails(undefined);
292288
}
293289

294-
if (apiResponse?.form) {
295-
resetFormData();
296-
setRawSchema(apiResponse.form);
297-
if (apiResponse.meta) {
298-
setHasNext(!!apiResponse.meta.hasNext);
299-
}
300-
setErrorDetails(undefined);
301-
}
302-
303290
// when we receive errors, we append to the scheme
304291
if (apiResponse?.validation_errors) {
305292
setErrorDetails(getErrorDetailsFromResponse(apiResponse));

0 commit comments

Comments
 (0)