-
Notifications
You must be signed in to change notification settings - Fork 416
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
Conversation
91ca122
to
8d7641e
Compare
There was a problem hiding this 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 :)
- You should also replace "projects" in useActionButtonActions.ts.
if (projectsData) { | ||
let statisticMap: Record<string, ProjectStatistic> = {}; | ||
|
||
if (projectsStatisticData && projectsStatisticData.content?.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
projectsStatisticData?.content?.length > 0
There was a problem hiding this comment.
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<
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
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