Skip to content

Switch from fetch to axios #453

Closed
@presleyp

Description

@presleyp

As a developer, I want my API calling functions to contain as little boilerplate as possible so I can easily understand them and quickly mock them. I also want the ability to easily add logging of requests or responses.

Currently, we use fetch for our API calls. Axios would cut down on boilerplate:

  • config sets some info once and for all
  • no need to unpack the json
  • no need to check ok
  • adding interceptors is easier (can be used for logging)
  • adding timeouts is easier
    These and other benefits are discussed here.

I suggest we switch from fetch to axios in the api file. We can move the in-component SWR calls over as we move them to XState.

Metadata

Metadata

Assignees

Labels

siteArea: frontend dashboard

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions