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

[TASK](supernova): introduce react query mutations with optimistic updates, remove old mutation related code #681

Open
Tracked by #621
TilmanHaupt opened this issue Dec 12, 2024 · 0 comments · May be fixed by #680
Assignees
Labels
refactor supernova All tasks related to supernova

Comments

@TilmanHaupt
Copy link
Contributor

TilmanHaupt commented Dec 12, 2024

Description:

The goal of this task is to replace the existing state management and API interaction logic involving localItems, client.js, serviceApi, and processingStatus with React Query's built-in mutation and refetching mechanisms.

Acceptance Criteria:

  • Use React Query's mutation instead of client.js and serviceApi
  • Optimistic Updates.
  • Delete the local state (localItems and processingStatus) while maintaining functionality
  • Implement refetching logic for updated data after mutations, ensuring that the UI remains consistent.
  • Verify that the application handles errors gracefully using React Query's error handling features.
  • Ensure tests are updated or added to cover the refactored functionality.

Notes:

Use React Query's useMutation for mutation operations and queryClient.invalidateQueries for refetching updated data.
Align the implementation with existing patterns in the codebase for consistency.
This refactor will improve data fetching consistency, reduce manual state management, and leverage React Query's powerful caching and synchronization features.

@TilmanHaupt TilmanHaupt self-assigned this Dec 12, 2024
@TilmanHaupt TilmanHaupt added supernova All tasks related to supernova refactor labels Dec 12, 2024
@TilmanHaupt TilmanHaupt changed the title [TASK](supernova): Remove clients.js, apiService, localItems and introduce mutations [TASK](supernova): introduce mutations with optimistic Updates, remove old mutation related code Dec 17, 2024
@TilmanHaupt TilmanHaupt changed the title [TASK](supernova): introduce mutations with optimistic Updates, remove old mutation related code [TASK](supernova): introduce react query mutations with optimistic Updates, remove old mutation related code Dec 17, 2024
@TilmanHaupt TilmanHaupt changed the title [TASK](supernova): introduce react query mutations with optimistic Updates, remove old mutation related code [TASK](supernova): introduce react query mutations with optimistic updates, remove old mutation related code Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor supernova All tasks related to supernova
Projects
None yet
1 participant