-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
caa0231
commit daae882
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# ADR 11: Axios for calls to the Jira API | ||
|
||
## Status | ||
|
||
accepted | ||
|
||
## Context | ||
|
||
We want to be able to configure the headers, base URL and other parameters once for Jira API calls, instead of each time we make a call as previous with the `fetch` and `cross-fetch` packages. | ||
|
||
## Decision | ||
|
||
We are now using [Axios](https://axios-http.com/docs/intro), a package that enables creation of REST clients and enables us to configure defaults for each call. | ||
Additionally, we are able to define error handlers for specific HTTP error calls, enabling default error handling for e.g. 401 responses. | ||
|
||
## Consequences | ||
|
||
Every call to the Jira Server API (except for authorization calls to e.g. fetch a token) should be made via an Axios instance. | ||
This also means rewriting the error handling in each call, finding common errors and enabling default handling for them. |