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

Add HTTP status code to kitsu responses #1041

Merged
merged 4 commits into from
Jan 3, 2025

Conversation

bglimepoint
Copy link
Contributor

@bglimepoint bglimepoint commented Dec 1, 2024

Thanks for Kitsu! It's awesome :-)

We wanted to know whether the HTTP status code was a 206 to know if we'd received a partial response - and were wondering if you'd be willing to land this tweak to add it to the result :-)

Also, on looking a bit closer, I noticed that this isn't in the other methods in the same file - would be willing to add it more places if that's helpful 🙂

@bglimepoint bglimepoint force-pushed the add-status-code-to-response branch from f158326 to 08a5d46 Compare December 1, 2024 23:26
@wopian wopian self-requested a review December 30, 2024 17:45
Copy link
Owner

@wopian wopian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR! Would you be able to change the variable name to statusCode for consistency and update the failing tests to have status codes expected.

packages/kitsu/src/index.js Outdated Show resolved Hide resolved
packages/kitsu/src/index.js Outdated Show resolved Hide resolved
This allows looking for status codes like 206 to know it's a partial response.
@bglimepoint bglimepoint force-pushed the add-status-code-to-response branch from 5f38523 to b8d41ee Compare January 3, 2025 00:49
@bglimepoint
Copy link
Contributor Author

Thanks @wopian!

Have updated the PR - including adding the status code to the other request types, but happy to adjust however you'd like :-)

@wopian
Copy link
Owner

wopian commented Jan 3, 2025

Thank you! These changes look great! After looking over it again I've opted to keep it the same as the property exposed by Axios (status). I've applied the changes to the PR :)

@wopian wopian changed the title Add status code to the result of Kitsu.prototype.request. Add HTTP status code to kitsu responses Jan 3, 2025
Copy link

codeclimate bot commented Jan 3, 2025

Code Climate has analyzed commit fa19526 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (100% is the threshold).

This pull request will bring the total coverage in the repository to 100.0% (0.0% change).

View more on Code Climate.

@wopian wopian merged commit 2d552ea into wopian:master Jan 3, 2025
12 checks passed
wopian added a commit that referenced this pull request Jan 3, 2025
* Add status code to the result of `Kitsu.prototype.request`.

This allows looking for status codes like 206 to know it's a partial response.

* refactor: replace statusCode with status

---------

Co-authored-by: James Harris <3440094+wopian@users.noreply.github.com>
@wopian
Copy link
Owner

wopian commented Jan 3, 2025

The changes have been released as kitsu@10.2.0

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

Successfully merging this pull request may close these issues.

2 participants