Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Get ID from headers #5

Merged
merged 2 commits into from
Mar 16, 2021
Merged

feat: Get ID from headers #5

merged 2 commits into from
Mar 16, 2021

Conversation

simenandre
Copy link
Member

As there are a few methods in the Fiken API where the body is empty, and users need to get the ID of a created resource.

Some of the methods in Fiken API you can create a resource, but it doesn't respond with any data. The same methods often/always sends a location header (e.g. location: https://api.fiken.no/api/v2/companies/fiken-demo-historisk-fasong-as1/bankAccounts/1933231237). This pull requests adds a function to retrieve the ID of that location header.

Example:

const res = await fiken.createBankAccountRaw({
  companySlug,
  bankAccountRequest,
});

const id = getIDFromHeaders(res.raw);
// example: id = 1933231237

@simenandre simenandre merged commit 29115fc into main Mar 16, 2021
@simenandre simenandre deleted the get-id-from-headers branch March 16, 2021 11:09
github-actions bot pushed a commit that referenced this pull request Mar 16, 2021
# [1.1.0](v1.0.2...v1.1.0) (2021-03-16)

### Features

* Get ID from headers ([#5](#5)) ([29115fc](29115fc))
@github-actions
Copy link

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant