From 92d7380f832c16ed8962626993f374661a991b78 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Tue, 8 Feb 2022 13:11:08 -0500 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20clean=20up=20unused=20n?= =?UTF-8?q?ew=20instances?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/admin/app/routes/scopes/scope/host-catalogs/new.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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}