Alina-Khmilevska / UPSA-React

This repository contains the source code for the UPSA Pharmaceutical Organization's website, developed using the React library.
1 stars 0 forks source link

added LocalRepresentatives component #28

Closed na-talia closed 1 year ago

na-talia commented 1 year ago

LocalRepresentatives component has been created. It displays our team members sorted by different cities.

The information is hardcoded and will be replaced with real data obtained from the server later.

na-talia commented 1 year ago

The dummy data in the LocalRepresentatives component has been replaced with data from the backend. The sorting is currently done based on the phone number rather than the city, as there is no city information in the data yet, and will be replaced in the future.

In api.js, the API_ENDPOINTS.TEAM was added, and in apiEndpoints.js, was added TEAM: "/upsa-api/team/kyiv", as this endpoint was already available and displaying data. In the future, this API_ENDPOINT needs to be replaced to display the necessary data.

If you have any questions, please feel free to ask!

Alina-Khmilevska commented 1 year ago

As I continue working on the backend, I'm pondering over the optimal approach for fetching user data. I have two methodologies in mind and would appreciate some input:

  1. Single Endpoint Approach: Fetching all users through one endpoint and then parsing them into categories on the client side.

  2. Multiple Endpoints Approach: Creating a separate endpoint for each city, allowing for more direct retrieval of user data per city.

@na-talia Which of these methods do you think would be more efficient and flexible for you?

na-talia commented 1 year ago

As I continue working on the backend, I'm pondering over the optimal approach for fetching user data. I have two methodologies in mind and would appreciate some input:

1. Single Endpoint Approach: Fetching all users through one endpoint and then parsing them into categories on the client side.

2. Multiple Endpoints Approach: Creating a separate endpoint for each city, allowing for more direct retrieval of user data per city.

@na-talia Which of these methods do you think would be more efficient and flexible for you?

It depends on how many cities will be in the list in general. Will there be only 3, as in the Figma design?

At first, I thought about fetching all users and then parsing them into categories on the client side, as we might use this endpoint on both the 'Find Friends' and 'View from List' pages. On the other hand, a separate endpoint for each city could also be used there.

It's hard to say which approach would be better in this case.

Alina-Khmilevska commented 1 year ago

Ok, thanks.

I'll think about a backend solution. After that, I will create issue to process the new data