Skip to content

Fetcher POS #245

@Xantass

Description

@Xantass

Description
Refactoring: Centralized Fetcher System with Axios

Acceptance Criteria
[ ] Centralize all API calls in dedicated services
[ ] Use Axios with interceptors to handle authentication automatically
[ ] Implement consistent HTTP error handling
[ ] Improve 401 error redirection (React Router instead of window.location.href)
[ ] Significantly reduce code duplication
[ ] Facilitate testing and future maintenance

Additional Context
Currently, API calls in the project use fetch scattered across multiple components, with a lot of duplicated code for:

  • Authentication management (adding tokens)
  • URL construction
  • Handling 401 errors
  • localStorage cleanup
    This duplication makes the code difficult to maintain and increases the risk of errors.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions