Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[OPIK-905] [FE] Split find project endpoint into two endpoints: find and stats #1175

Merged
merged 3 commits into from
Jan 30, 2025

Conversation

andriidudar
Copy link
Contributor

Details

FE makes 2 requests on the Home and Projects page to retrieve projects with statistics.

Issues

Resolves #

Testing

Documentation

https://www.notion.so/cometml/Project-Endpoint-Split-18a7124010a380f8a9a7e47f4af17fcc?d=18a7124010a3807783d5001c94873d63#18a7124010a380db83fcc91fa252f529

@andriidudar andriidudar requested a review from a team as a code owner January 30, 2025 10:33
@andriidudar andriidudar force-pushed the andriidudar/OPIK-905-project-stats branch from 91ca122 to 8d7641e Compare January 30, 2025 11:07
aadereiko
aadereiko previously approved these changes Jan 30, 2025
Copy link
Collaborator

@aadereiko aadereiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, the functionality is smooth as well :)

  1. You should also replace "projects" in useActionButtonActions.ts.

if (projectsData) {
let statisticMap: Record<string, ProjectStatistic> = {};

if (projectsStatisticData && projectsStatisticData.content?.length > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

projectsStatisticData?.content?.length > 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will lead to the next type of error:
src/hooks/useProjectWithStatisticsList.ts:47:11 - error TS18048: 'projectsStatisticData.content.length' is possibly 'undefined'. 47 if (projectsStatisticData?.content?.length > 0) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/hooks/useProjectWithStatisticsList.ts:48:24 - error TS18048: 'projectsStatisticData' is possibly 'undefined'. 48 statisticMap = projectsStatisticData.content.reduce<

@andriidudar
Copy link
Contributor Author

The code looks good, the functionality is smooth as well :)

  1. You should also replace "projects" in useActionButtonActions.ts.

Done

@aadereiko aadereiko self-requested a review January 30, 2025 12:53
Copy link
Collaborator

@aadereiko aadereiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@andriidudar andriidudar merged commit e38030c into main Jan 30, 2025
2 checks passed
@andriidudar andriidudar deleted the andriidudar/OPIK-905-project-stats branch January 30, 2025 14:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants