From c13b7d04e87521c49dfd0c70343c84d0e7a3ec52 Mon Sep 17 00:00:00 2001 From: Kitteh Date: Wed, 5 May 2021 17:09:38 +0100 Subject: [PATCH] Fix a bug in k/v creation. --- src/api.js | 4 ++-- src/pages/KeyValue/KeyValueNew.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api.js b/src/api.js index c7a2952..135d8a6 100644 --- a/src/api.js +++ b/src/api.js @@ -256,10 +256,10 @@ export async function createOrUpdateSecret(baseMount, secretPath, name, data) { let APIData = {}; if (pageState.currentMountType == "kv-v2") { - secretURL = `/v1/${baseMount}/data/${secretPath.join("")}/${name}`; + secretURL = `/v1/${baseMount}/data/${secretPath.join("/")}/${name}`; APIData = { "data": data }; } else { - secretURL = `/v1/${baseMount}/${secretPath.join("")}/${name}`; + secretURL = `/v1/${baseMount}/${secretPath.join("/")}/${name}`; APIData = data; } diff --git a/src/pages/KeyValue/KeyValueNew.js b/src/pages/KeyValue/KeyValueNew.js index eb9660e..02a33bf 100644 --- a/src/pages/KeyValue/KeyValueNew.js +++ b/src/pages/KeyValue/KeyValueNew.js @@ -64,10 +64,11 @@ export class KeyValueNewPage extends Page { keyData = { "key": "value" }; } + console.log(splitPath) createOrUpdateSecret( pageState.currentBaseMount, pageState.currentSecretPath, - splitPath[splitPath.length - 1], + path, keyData ).then(_ => { changePage("KEY_VALUE_VIEW");