Skip to content

[REFACTOR]: some part of timed are loading the same data from the backend twice #1199

@MitanOmar

Description

@MitanOmar

What to refactor

creating a service to load immutable data once

Why refactor it

to not make useless requests to the backend, since those data already loaded

How to refactor it

For example, when i am loading analysis page, there are two request going to the backend to fetch the users list.

and that is because the responsible component about trigger the request is UserSelection component,
and since it's rendered twice for User and Reviewer, it's triggering the request twice

and also in the Timesheet page, the customers list also loaded twice because of Tracking service, and also because of empty ReportRow component.

It will be better that we are making one service to fetch those endpoint once, and share those data across other pages, without needing to trigger the requests.

since the employees list and the customers list are very rare to be updated

Required

  • I have checked past issues to ensure that this isn't a duplicate.

Metadata

Metadata

Assignees

Labels

refactorThis issue or pull request discusses refactoring

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions