File tree Expand file tree Collapse file tree 5 files changed +10
-19
lines changed
frontend/packages/pydantic-forms/src Expand file tree Collapse file tree 5 files changed +10
-19
lines changed Original file line number Diff line number Diff line change @@ -301,8 +301,7 @@ export const getFieldBySection = (components: PydanticFormComponents) => {
301301 */
302302export const getFormValuesFromFieldOrLabels = (
303303 pydanticFormSchema : PydanticFormSchema ,
304- // eslint-disable-next-line @typescript-eslint/no-explicit-any
305- labelData ?: Record < string , any > ,
304+ labelData ?: Record < string , string > ,
306305) => {
307306 const fieldValues : Record < string , string > = { } ;
308307
Original file line number Diff line number Diff line change 1- /* eslint-disable @typescript-eslint/no-explicit-any */
2-
31/**
42 * Pydantic Forms
53 *
@@ -22,12 +20,7 @@ import type {
2220 PydanticFormMetaData ,
2321} from '@/types' ;
2422
25- const ignoreApiErrors = async (
26- req : Promise < unknown > ,
27- // ignoreCodes: number[],
28- // eslint-disable-next-line @typescript-eslint/no-explicit-any
29- ) : Promise < any > => {
30- // TODO: What to use these for: ignoreCodes
23+ const ignoreApiErrors = async ( req : Promise < unknown > ) : Promise < unknown > => {
3124 try {
3225 return await req ;
3326 } catch ( error ) {
Original file line number Diff line number Diff line change 11import useSWR from 'swr' ;
22
3- import { PydanticFormCustomDataProvider , PydanticFormLabels } from '@/types' ;
3+ import {
4+ PydanticFormCustomDataProvider ,
5+ PydanticFormLabelProviderResponse ,
6+ } from '@/types' ;
47
58export const useCustomDataProvider = (
69 customDataProviderCacheKey : number ,
710 customDataProvider ?: PydanticFormCustomDataProvider ,
811) => {
9- return useSWR < PydanticFormLabels > (
12+ return useSWR < PydanticFormLabelProviderResponse [ 'data' ] > (
1013 // cache key
1114 [ `pydanticFormsDataProvider-${ customDataProviderCacheKey } ` ] ,
1215
Original file line number Diff line number Diff line change 1- /* eslint-disable @typescript-eslint/no-explicit-any */
2-
31/**
42 * Pydantic Forms
53 *
Original file line number Diff line number Diff line change @@ -308,11 +308,9 @@ interface PydanticFormComponent {
308308
309309export type PydanticFormComponents = PydanticFormComponent [ ] ;
310310
311- export type PydanticFormCustomDataProvider = ( ) => Promise < PydanticFormLabels > ;
312-
313- export interface PydanticFormLabels {
314- [ key : string ] : string [ ] | number [ ] | string | number | null ;
315- }
311+ export type PydanticFormCustomDataProvider = ( ) => Promise <
312+ PydanticFormLabelProviderResponse [ 'data' ]
313+ > ;
316314
317315export type PydanticFormLabelProvider = ( {
318316 formKey,
You can’t perform that action at this time.
0 commit comments