get rid of circular references in viewer.eventTypes (#1198)

This commit is contained in:
Alex Johansson authored and GitHub committed 2021-11-24 10:42:55 +00:00
1 parent 58f55f84e2
commit deb97fdab0
2 files changed
+25 -21

No files matched your search

+4 -2
View File
@@ -239,8 +239,10 @@ const loggedInViewerRouter = createProtectedRouter()
const canAddEvents = user.plan !== "FREE" || eventTypeGroups[0].eventTypes.length < 1;
return {
canAddEvents,
user,
viewer: {
canAddEvents,
plan: user.plan,
},
// don't display event teams without event types,
eventTypeGroups: eventTypeGroups.filter((groupBy) => !!groupBy.eventTypes?.length),
// so we can show a dropdown when the user has teams