From 2f5928be841cf1057a6a54628b27cbcabe942119 Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Tue, 21 Jun 2022 22:30:14 +0530 Subject: [PATCH] Fix ordering of event-types (#3126) --- apps/web/pages/[user]/[type].tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/web/pages/[user]/[type].tsx b/apps/web/pages/[user]/[type].tsx index 713841026c..ed25ac3f13 100644 --- a/apps/web/pages/[user]/[type].tsx +++ b/apps/web/pages/[user]/[type].tsx @@ -87,6 +87,15 @@ async function getUserPageProps(context: GetStaticPropsContext) { darkBrandColor: true, eventTypes: { select: { id: true }, + // Order by position is important to ensure that the event-type that's enabled is the first in the list because for Free user only first is allowed. + orderBy: [ + { + position: "desc", + }, + { + id: "asc", + }, + ], }, }, });