Repository navigation
feat: Shared Mobile API Client - #14
Open
PlainOlSoapBar wants to merge 7 commits into
Open
PlainOlSoapBar wants to merge 7 commits into
PlainOlSoapBar wants to merge 7 commits into
Conversation
apiClient.ts has a single change of a new line. Whatever makes the Prettier/formatter checks happy I guess.
PlainOlSoapBar
requested review from
Umar-Azizadah
and
a balanced review from Copilot
October 8, 2026 07:34
Collaborator
Author
|
I didn't even mean to add copilot as a reviewer lol, and now I can't remove it :V |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #6:
Create a standardized API for writing/calling backend requests and throwing API-related errors.
New files:
src/services/api/apiClient.ts- ApiClient implementation.src/services/api/apiError.ts- ApiClient's AppError definitions and class constructor.src/types/apiClient.types.ts- Type & interface definitions for ApiClient.src/docs/api-client.md- Documentation on ApiCilent's types, interfaces, and AppErrors.Developers can create ApiClients via
createApiClient()and passing in abodyUrl, an optionaltokenProvider, andtimeoutMs.Using this client, they can call the four GET/POST/PUT/DELETE requests. These requests can be aborted by timeout or manual cancellation.
Tests
Run the new tests with:
npm run test -- ./test/apiClient.test.ts.This should be result: