@pathmaker-digital/pmd-utilities - v2.2.6
    Preparing search index...

    Function proFetchGet

    • A "pro" implementation of generic fetch/get.

      Parameters

      • host: string

        Host address to fetch from.

      • endpoint: string

        Endpoint to target.

      • query: { field: string; value: any }[]

        Query options

      • log: boolean = false

        Whether to log responses or not. Defaults to false.

      Returns Promise<any>

      const response = await proFetchGet(
      "https://api.example.com",
      "users",
      [{ field: "role", value: "admin" }, { field: "active", value: true }],
      true
      );
      console.log(response); // Logs the filtered user data if successful.