Closed AndrzejStarzyk closed 1 year ago
@AndrzejStarzyk Is this PR ready for review or will you make more changes? I am asking because you pushed new commits a few days ago but haven't requested a review again and I am unsure if I should look at the code or wait.
I implemented changes that you suggested, but I didn't know how to re-review this PR. I had been hoping a bigger discussion would have happen during the seminar. Anyway I'm sorry for any problems and delays.
Moving forward I suspect I should create access to data from backend at other parts of frontend application. But if anything needs to be done or fixed I can get on with it.
I think you need to change the logic on the backend and return data in some other shape. Now we need to map data on the frontend and merge location with sensor data. These pieces of information can be returned in a single response and make the processing easier on the frontend side.
I would also suggest not using services in React. They are common in Angular but React has some easier to use libraries that we can use instead of writing services manually. If you wish, we can make a call someday and do it together.
I'va added suggested fixes and improved format of data fetched from backend. I hope the code is better and cleaner now, but I remain ready to make more improvements and add further features if needed. I still need a liitle bit of time to replace service with better solution. I suspect that the code should be move to UseEffect function where fetched data is needed, but I would really like to discuss better solutions.
Fetching locations of sensors and sample data from them data from backend and accordingly displaying it