chore: 🤖 redirect to index on save in create-without-read case

This commit is contained in:
Randall Morey committed 2021-09-08 15:04:23 -04:00
1 parent 8f11765b96
commit 16e83b7428
2 files changed
+18 -8

No files matched your search

@@ -59,10 +59,16 @@ export default class ScopesScopeHostCatalogsHostCatalogHostSetsRoute extends Rou
)
async save(hostSet) {
await hostSet.save();
await this.transitionTo(
'scopes.scope.host-catalogs.host-catalog.host-sets.host-set',
hostSet
);
if (this.can.can('read model', hostSet)) {
await this.transitionTo(
'scopes.scope.host-catalogs.host-catalog.host-sets.host-set',
hostSet
);
} else {
await this.transitionTo(
'scopes.scope.host-catalogs.host-catalog.host-sets'
);
}
this.refresh();
}
@@ -58,10 +58,14 @@ export default class ScopesScopeHostCatalogsHostCatalogHostsRoute extends Route
)
async save(host) {
await host.save();
await this.transitionTo(
'scopes.scope.host-catalogs.host-catalog.hosts.host',
host
);
if (this.can.can('read model', host)) {
await this.transitionTo(
'scopes.scope.host-catalogs.host-catalog.hosts.host',
host
);
} else {
await this.transitionTo('scopes.scope.host-catalogs.host-catalog.hosts');
}
this.refresh();
}