centurion-ui
    Preparing search index...

    Function useDjangoFetcher

    • This Fetcher sets up everything required to fetch datasets from a backend that is Django.

      Parameters

      • __namedParameters: djangoFetcherNamedParams

        Named Parameters for Django Fetcher.

        • OptionalbaseURL?: string

          Backend base URL.

          This value is always to be supplied when a loader is calling. Additionally you should not supply this param a value as it is a requirement that all fetchers ignore it and obtain the backend.url via the BackendProvider from the nearest BackendLayout.

        • Optionalbody?: BodyInit

          Body to use for request.

        • OptionalgetMetadata?: boolean

          Additionally, fetch metadata

        • Optionalmethod?: "GET" | "OPTIONS" | "POST" | "PATCH"

          HTTP method to use for the request.

          method = "OPTIONS"
          

          Note: Calling with method OPTIONS will force only obtaining the apiMetadata.

        • OptionalonlyMetadata?: boolean

          Only fetch metadata

        • Optionalsignal?: AbortSignal

          Request signal.

        • url: string

          URL for the request to be made against.

      Returns Promise<{ apiData: Response; apiMetadata: Response }>

      const { apiMetadata, apiData } = await useDjangoFetcher({
      url: '/',
      onlyMetadata: true
      });

      const data = await apiMetadata.clone().json();

      0.13.0