Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Ensure client in static methods has the same behavior as makeRequest #184

@razor-x

Description

@razor-x

The Seam makeRequest method ensures consistent behavior when making any http request to the Seam API. The http call in the new public method should use makeRequest. We need to factor out makeRequest to a normal function and call it in both makeRequest and any static methods.


          @azat-co I didn't save my comment 😭 

Anyway, was just going to say we should make sure to respect axiosOptions, so like in the constructor, something like

    const client = axios.create({
      ...axiosOptions,
      baseURL: endpoint,
      headers,
    })

   await client.post(...)

Looking closer, I just realized the normal client behavior does a bit more, like always throw SeamAPIError. We should factor out the client creation method and use it both places. I will make an issue for that.

Originally posted by @razor-x in seamapi/javascript#176 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions