diff --git a/src/renameCollection.ts b/src/renameCollection.ts index 6f92544..08c78b9 100644 --- a/src/renameCollection.ts +++ b/src/renameCollection.ts @@ -40,7 +40,7 @@ export function renameCollection() { }, body: JSON.stringify({ label: newLabel, - csrf_token: scrfInput.value, + csrf_token: scrfInput ? scrfInput.value : '', }), }); if (response.status == 200) { diff --git a/src/renameSection.ts b/src/renameSection.ts index 8e8173d..a1ddc3d 100644 --- a/src/renameSection.ts +++ b/src/renameSection.ts @@ -12,7 +12,6 @@ export function renameSection() { document.querySelectorAll(`[id^="edit-section-label-"]`); const scrfInput: HTMLInputElement = document.querySelector('#csrf_token'); - console.log(scrfInput.value); const oldName = inputsForRename[index].value; inputsForRename[index].removeAttribute('readonly'); inputsForRename[index].value = oldName; @@ -44,7 +43,7 @@ export function renameSection() { body: JSON.stringify({ label: newLabel, section_id: sectionId, - csrf_token: scrfInput.value, + csrf_token: scrfInput ? scrfInput.value : '', }), }); if (response.status == 200) { diff --git a/src/renameSubCollection.ts b/src/renameSubCollection.ts index 3f6487c..8d5c205 100644 --- a/src/renameSubCollection.ts +++ b/src/renameSubCollection.ts @@ -44,7 +44,7 @@ export function renameSubCollection() { }, body: JSON.stringify({ label: newLabel, - csrf_token: scrfInput.value, + csrf_token: scrfInput ? scrfInput.value : '', }), }); if (response.status == 200) {