refactor: 💡 migrate to router.replaceWith due to deprecations

This commit is contained in:
Randall Morey committed 2022-01-03 12:12:53 -05:00
1 parent 046e9fdf4c
commit 7e354df44c
31 files changed
+147 -55

No files matched your search

@@ -11,6 +11,8 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsRoute extends Route
@service intl;
@service notify;
@service can;
@service router;
// =methods
/**
@@ -82,7 +84,9 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsRoute extends Route
@notifySuccess('notifications.delete-success')
async deleteAccount(account) {
await account.destroyRecord();
await this.replaceWith('scopes.scope.auth-methods.auth-method.accounts');
await this.router.replaceWith(
'scopes.scope.auth-methods.auth-method.accounts'
);
this.refresh();
}
}
@@ -9,6 +9,7 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountSettingsRout
@service intl;
@service notify;
@service router;
// =methods
@@ -40,7 +41,7 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountSettingsRout
@notifySuccess('notifications.save-success')
async setPassword(account, password) {
await account.setPassword(password);
await this.replaceWith(
await this.router.replaceWith(
'scopes.scope.auth-methods.auth-method.accounts.account.set-password'
);
}
@@ -11,6 +11,7 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsRoute extends
@service intl;
@service notify;
@service can;
@service router;
//=methods
@@ -80,7 +81,7 @@ export default class ScopesScopeAuthMethodsAuthMethodManagedGroupsRoute extends
@notifySuccess('notifications.delete-success')
async delete(managedGroup) {
await managedGroup.destroyRecord();
await this.replaceWith(
await this.router.replaceWith(
'scopes.scope.auth-methods.auth-method.managed-groups'
);
this.refresh();