feat: use week start from owner (#7072)

This commit is contained in:
Nafees Nazik 2023-02-13 21:51:55 +05:30 committed by GitHub
parent c2a8f799ff
commit a2549bd7b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
},