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

pull/9862/head
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
1 changed files with 8 additions and 3 deletions

View File

@ -105,11 +105,16 @@ const Route = ({
userId: form.userId, userId: form.userId,
}, },
}); });
if (!eventTypeValidInContext) {
return;
}
group.eventTypes.forEach((eventType) => { group.eventTypes.forEach((eventType) => {
const uniqueSlug = `${group.profile.slug}/${eventType.slug}`; 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({ eventOptions.push({
label: uniqueSlug, label: uniqueSlug,
value: uniqueSlug, value: uniqueSlug,