diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bc1edbf0..24bc5b18c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [4.43.1] - 2021-06-08 +### Fixed + +- Update routes listing when a binding user route is created from an app route + ### Changed - Shortened the message from the temporary warning banner for the `newadmin` workspaces. diff --git a/react/components/admin/pages/Form/utils.ts b/react/components/admin/pages/Form/utils.ts index 3c7f55632..ced5b7d50 100644 --- a/react/components/admin/pages/Form/utils.ts +++ b/react/components/admin/pages/Form/utils.ts @@ -98,6 +98,11 @@ export const updateStoreAfterSave = ( const savedRouteId = savedRoute && savedRoute.uuid const matchedRoute = routes.find(route => route.uuid === savedRouteId) + const appRouteIdx = routes.findIndex( + route => + route.declarer && !route.binding && route.path === savedRoute.path + ) + if (matchedRoute) { const idx = routes.indexOf(matchedRoute) routes[idx] = savedRoute @@ -105,6 +110,10 @@ export const updateStoreAfterSave = ( routes.push(savedRoute) } + if (appRouteIdx !== -1) { + routes.splice(appRouteIdx, 1) + } + const newData = { ...queryData, routes,