Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "data/Instance"

Index

Functions

formFieldsToInstanceItem

  • formFieldsToInstanceItem<T>(formFields: Record<string, any>, entityName: string, metadata: MetaClassInfo[], stringIdName?: undefined | string): Record<string, any>
  • Transforms the antd Form fields values into format expected by Instance item, which is generally the same as the format expected by REST API, except that Instance item may have the following properties that are stripped before the commit:

    • a temporary id created client-side
    • read-only attributes

    Type parameters

    • T

    Parameters

    • formFields: Record<string, any>
    • entityName: string
    • metadata: MetaClassInfo[]
    • Optional stringIdName: undefined | string

    Returns Record<string, any>

instance

instanceItemToFormFields

  • instanceItemToFormFields<T>(item: Record<string, any> | undefined, entityName: string, metadata: MetaClassInfo[], displayedProperties?: string[], stringIdName?: undefined | string): Record<string, any>
  • Transforms the provided item into the format expected by Ant Design Form fields.

    Type parameters

    • T

      entity type.

    Parameters

    • item: Record<string, any> | undefined

      entity instance to be transformed.

    • entityName: string
    • metadata: MetaClassInfo[]

      entities metadata.

    • Optional displayedProperties: string[]

      entity properties that should be included in the result. If not provided, all properties will be included.

    • Optional stringIdName: undefined | string

    Returns Record<string, any>

stripTemporaryIds

  • stripTemporaryIds(item: Record<string, any>): Record<string, any>
  • deprecated

    To be removed from public API

    Parameters

    • item: Record<string, any>

    Returns Record<string, any>

Const useInstance

Const withDataInstance

Generated using TypeDoc