fix: Legacy Routing Forms handling - Allow team Event in existing non-team Routing forms (#9852)

This commit is contained in:
Hariom Balhara 2023-06-30 20:28:14 +05:30 committed by GitHub
parent 000f39b9c8
commit be40e4b4b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,11 +105,16 @@ const Route = ({
userId: form.userId,
},
});
if (!eventTypeValidInContext) {
return;
}
group.eventTypes.forEach((eventType) => {
const uniqueSlug = `${group.profile.slug}/${eventType.slug}`;
const isRouteAlreadyInUse = isRouter(route) ? false : uniqueSlug === route.action.value;
// If Event is already in use, we let it be so as to not break the existing setup
if (!isRouteAlreadyInUse && !eventTypeValidInContext) {
return;
}
eventOptions.push({
label: uniqueSlug,
value: uniqueSlug,