Skip to content

Scheduling infrastructure for absolutely everyone.

feat: use week start from owner (#7072)

Nafees Nazika2549bd7b6de
diff --git a/apps/web/pages/team/[slug]/[type].tsx b/apps/web/pages/team/[slug]/[type].tsx
index f07f585ea98..2876911dd1b 100644
--- a/apps/web/pages/team/[slug]/[type].tsx
+++ b/apps/web/pages/team/[slug]/[type].tsx
@@ -100,6 +100,22 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
availability: true,
},
},
+ team: {
+ select: {
+ members: {
+ where: {
+ role: "OWNER",
+ },
+ select: {
+ user: {
+ select: {
+ weekStart: true,
+ },
+ },
+ },
+ },
+ },
+ },
},
},
},
@@ -148,6 +164,8 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
booking = await getBooking(prisma, rescheduleUid);
}
+ const weekStart = eventType.team?.members?.[0]?.user?.weekStart;
+
return {
props: {
profile: {
@@ -155,7 +173,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
slug: team.slug,
image: team.logo,
theme: team.theme,
- weekStart: "Sunday",
+ weekStart: weekStart ?? "Sunday",
brandColor: team.brandColor,
darkBrandColor: team.darkBrandColor,
},