Problem
The frontend API client logic is currently repeated across multiple modules in the codebase. Common functions, such as attaching the CSRF header, are duplicated, leading to code redundancy and higher maintenance effort.
Proposal
-
Refactor API Client:
- Extract shared logic (e.g., CSRF header management) into a single, reusable API client module.
- Replace repeated code across modules with calls to the centralized API client.
-
Investigate Modern Data Fetching:
- Evaluate adopting a more modern approach for data fetching on the frontend. Specifically, consider implementing @tanstack/react-query to manage server state, caching, and data synchronization efficiently.
- Move away from manual
fetch operations within useEffect hooks, and migrate major affected areas to use the chosen modern solution.
Problem
The frontend API client logic is currently repeated across multiple modules in the codebase. Common functions, such as attaching the CSRF header, are duplicated, leading to code redundancy and higher maintenance effort.
Proposal
Refactor API Client:
Investigate Modern Data Fetching:
fetchoperations withinuseEffecthooks, and migrate major affected areas to use the chosen modern solution.