Fixed duplicate path issue for kv engine (#11423)
- Ids used to collide in ember data while creating a secret with any existing path name from a different kv engine
This commit is contained in:
parent
b7ed30afed
commit
45e2bfcad7
|
@ -199,6 +199,13 @@ export default Component.extend(FocusOnInsertMixin, WithNavToNearestAncestor, {
|
|||
secretData.set(secretData.pathAttr, key);
|
||||
}
|
||||
|
||||
if (this.mode === 'create') {
|
||||
key = JSON.stringify({
|
||||
backend: secret.backend,
|
||||
id: key,
|
||||
});
|
||||
}
|
||||
|
||||
return secretData
|
||||
.save()
|
||||
.then(() => {
|
||||
|
@ -323,8 +330,14 @@ export default Component.extend(FocusOnInsertMixin, WithNavToNearestAncestor, {
|
|||
return;
|
||||
}
|
||||
|
||||
this.persistKey(() => {
|
||||
this.transitionToRoute(SHOW_ROUTE, this.model.path || this.model.id);
|
||||
this.persistKey(key => {
|
||||
let secretKey;
|
||||
try {
|
||||
secretKey = JSON.parse(key).id;
|
||||
} catch (error) {
|
||||
secretKey = key;
|
||||
}
|
||||
this.transitionToRoute(SHOW_ROUTE, secretKey);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue