diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/new.js b/ui/admin/app/routes/scopes/scope/host-catalogs/new.js index 40cf6f01a..588ecac90 100644 --- a/ui/admin/app/routes/scopes/scope/host-catalogs/new.js +++ b/ui/admin/app/routes/scopes/scope/host-catalogs/new.js @@ -17,6 +17,14 @@ export default class ScopesScopeHostCatalogsNewRoute extends Route { // =methods + /** + * Rollback/destroy any new, unsaved instances from this route before + * creating another. + */ + beforeModel() { + if (this.currentModel?.isNew) this.currentModel.rollbackAttributes(); + } + /** * Creates a new unsaved host catalog belonging to the current scope. * @return {HostCatalogModel}