Skip to content

Commit fd94eed

Browse files
authored
Merge pull request #51 from workfloworchestrator/1719-revalidate-api-if-stale
1719 revalidate api if stale
2 parents 90eae3a + 487a561 commit fd94eed

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
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+
Refetches form definiton everytime the form is loaded

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,6 @@ function PydanticFormContextProvider({
8888
cancelButton,
8989
} = config;
9090

91-
// TODO: Fix this again
92-
// option to enable the debug mode on the fly in the browser
93-
// by setting localStorage.setItem("pydanticFormsDebugMode", "true")
94-
// reload is required
95-
const debugMode = false;
96-
97-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
9891
const [formInputData, setFormInputData] = useState<object[]>([]);
9992

10093
const addFormInputData = (formInput: object) => {
@@ -336,7 +329,6 @@ function PydanticFormContextProvider({
336329
onCancel,
337330
title,
338331
sendLabel,
339-
debugMode,
340332
isFullFilled,
341333
customDataProvider,
342334
errorDetails,

frontend/packages/pydantic-forms/src/core/hooks/useApiProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ export function useApiProvider(
7171
{
7272
fallback: {},
7373

74-
// we dont want to refresh the form structure automatically
75-
revalidateIfStale: false,
74+
// We revalidate to make sure the form updates when we use it a second time
75+
revalidateIfStale: true,
7676
revalidateOnReconnect: false,
7777
revalidateOnFocus: false,
7878
keepPreviousData: true,

frontend/packages/pydantic-forms/src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export interface PydanticFormContextProps {
5353
rhf: ReturnType<typeof useForm>;
5454
errorDetails?: PydanticFormValidationErrorDetails;
5555
pydanticFormSchema?: PydanticFormSchema;
56-
debugMode?: boolean;
5756
title?: string | boolean;
5857
sendLabel?: string;
5958
onCancel?: () => void;

0 commit comments

Comments
 (0)