mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-03 20:40:45 -05:00
* remove cluster route and model boundary route mixins * add copyright header * remove old unit test * change replication/application route * don't use cluster route in replication * why have a base class at all? * test tweaks * remove afterModel redirect in replication * refactor targetRouteName to use derived state * Update route class name on replication-dr-promote.js --------- Co-authored-by: Matthew Irish <39469+meirish@users.noreply.github.com> Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
18 lines
459 B
JavaScript
18 lines
459 B
JavaScript
/**
|
|
* Copyright IBM Corp. 2016, 2025
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
export default function clearModelCache(store, modelType) {
|
|
if (!modelType) {
|
|
return;
|
|
}
|
|
const modelTypes = Array.isArray(modelType) ? modelType : [modelType];
|
|
if (store.isDestroyed || store.isDestroying) {
|
|
// Prevent unload attempt after test teardown, resulting in test failure
|
|
return;
|
|
}
|
|
modelTypes.forEach((type) => {
|
|
store.unloadAll(type);
|
|
});
|
|
}
|