Options
All
  • Public
  • Public/Protected
  • All
Menu

Module fetch/translatePath

Index

Functions

Functions

Const default

  • default(apiUrl: string, path: string, requestInit?: {}, res?: boolean | ServerResponse<IncomingMessage>, fetch?: fetchAdapter, onError?: (err: Error) => void): Promise<void | TJsonApiBody>
  • helper function to make it easier to resolve a path to an entity ID

    Parameters

    • apiUrl: string

      the api url for the JON:API endpoint

    • path: string

      the path to the node

    • requestInit: {} = {}

      fetch initialization object

    • res: boolean | ServerResponse<IncomingMessage> = false

      response object

    • fetch: fetchAdapter = ...

      fetch compatible function

    • onError: (err: Error) => void = ...
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns Promise<void | TJsonApiBody>

    a promise containing the data for the JSON:API response

Generated using TypeDoc