fix event type options (#7473)

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
pull/7467/head
Carina Wollendorfer 2023-03-03 11:36:23 -05:00 committed by GitHub
parent d8387835a8
commit 056edd8ec2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -42,8 +42,10 @@ export default function WorkflowDetailsPage(props: Props) {
const eventTypeOptions = useMemo(
() =>
data?.eventTypeGroups.reduce((options, group) => {
/** only show event types that belong to team or user */
if (!(!teamId && !group.teamId) || teamId !== group.teamId) return options;
/** don't show team event types for user workflow */
if (!teamId && group.teamId) return options;
/** only show correct team event types for team workflows */
if (teamId && teamId !== group.teamId) return options;
return [
...options,
...group.eventTypes.map((eventType) => ({