Redirect on reapply error (#2114)

* chore: 🤖 redirect to list on reapply error
This commit is contained in:
Dharini Jeeva authored and GitHub committed 2024-01-26 10:13:16 -08:00
1 parent def6959ee7
commit 8f34d83c15
1 file changed
+8 -4
@@ -12,7 +12,7 @@ export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConne
// =services
@service store;
@service session;
@service router;
// =methods
/**
@@ -50,7 +50,6 @@ export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConne
storageBucket,
};
}
/**
* Reapplies storage policy dates to session recording
* @param {SessionRecordingModel}
@@ -63,7 +62,12 @@ export default class ScopesScopeSessionRecordingsSessionRecordingChannelsByConne
: 'resources.policy.messages.reapply',
)
async reapplyStoragepolicy(sessionRecording) {
await sessionRecording.reapplyStoragePolicy();
super.refresh(...arguments);
try {
await sessionRecording.reapplyStoragePolicy();
} catch (e) {
await this.router.replaceWith('scopes.scope.session-recordings');
this.router.refresh();
throw new Error(e);
}
}
}