Skip to content

Refactor frontend API client and modernize data fetching #232

@payamnj

Description

@payamnj

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

  1. 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.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions