-
Notifications
You must be signed in to change notification settings - Fork 33
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
Refactor api to simplify code and add proper errors #238
Merged
Conversation
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
Refactoring is not completed yet, but it is already an improvement and I want to keep the pr small so it is easier to review. |
jippi
reviewed
Jan 27, 2025
- replace selfPut (was used only in editing a post - I tested it with new method and it still works) - and change getStatusById to get id directly - because thats easier to understand and type
…but ignore unused also fix report action when Profile screen is opened via username instead of id
Simon-Laux
force-pushed
the
simon/api-context
branch
from
January 27, 2025 13:06
7c10c76
to
9d07d4d
Compare
…works until that point
Kwasow
approved these changes
Jan 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing to add to what's already been said by @jippi
…ugh images (the scroll area was cuting off in the middle of the screen)
and Fix error ectraction from api result again
dansup
approved these changes
Feb 5, 2025
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.
This pr introduces an API context class that has the methods to make requests.
I tries to deduplicate/simplify code, and also making failing request throw an error, like react query mutations expects it.
it is one step into switching accounts easily.
Some progress with typescript typings was also made.
I also added an error screen for the profile screen when an account can not be found, which also shows a search button when it was opened from a username to lessen the impact of #240 :
ScreenRecording_01-27-2025.02-15-24_1.MP4
useLocalSearchParams
and add types some more places