New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: view team bookings #14079
fix: view team bookings #14079
Conversation
…han/cal.com into fix/view-team-bookings
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (03/14/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (03/14/24)1 label was added to this PR based on Keith Williams's automation. "Add foundation team as reviewer" took an action on this PR • (03/14/24)1 reviewer was added to this PR based on Keith Williams's automation. |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
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.
From this comment, I'm not seeing any select
fields in the queries. #13591 (review)
Let's figure out the minimum amount of data we need from the DB for this endpoint.
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.
@joeauyeung how about now?
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.
@SomayChauhan I like this commit: 0aa47bd
(#14079)
I'll approve for now, but let's see what @keithwillcode and @zomars have to say.
As a follow up I found two things that we can improve on:
getUniqueBookings
filters duplicate bookings based onuid
but when getting the nested fields from the bookings we filter onid
. We should changegetUniqueBookings
to filter on justid
s to reduce the amount of data we need to initially query the database for.- Optimize
getUniqueBookings
- Right now it loops through the array of bookings theoretically two times but I think we can cut it down to once
const getUniqueBookings = <T extends { uid: string }>(arr: T[]) => {
const unique = new Set();
arr.forEach((booking) => {
set.add(booking.uid);
});
return [ ...unique.values() ];
};
For some reason e2e tests are broken. Will revisit after release. |
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.
Tests passing, looks ready to go! :)
This reverts commit f86c448.
What does this PR do?
re-doing #13591 - that was reverted due to DB load issues introduced.
Fixes #13582