fix rename(local)

This commit is contained in:
SvyatoslavArtymovych 2023-06-02 11:17:37 +03:00
parent 757c9d1a03
commit 2e18863200
3 changed files with 3 additions and 4 deletions

View File

@ -40,7 +40,7 @@ export function renameCollection() {
}, },
body: JSON.stringify({ body: JSON.stringify({
label: newLabel, label: newLabel,
csrf_token: scrfInput.value, csrf_token: scrfInput ? scrfInput.value : '',
}), }),
}); });
if (response.status == 200) { if (response.status == 200) {

View File

@ -12,7 +12,6 @@ export function renameSection() {
document.querySelectorAll(`[id^="edit-section-label-"]`); document.querySelectorAll(`[id^="edit-section-label-"]`);
const scrfInput: HTMLInputElement = const scrfInput: HTMLInputElement =
document.querySelector('#csrf_token'); document.querySelector('#csrf_token');
console.log(scrfInput.value);
const oldName = inputsForRename[index].value; const oldName = inputsForRename[index].value;
inputsForRename[index].removeAttribute('readonly'); inputsForRename[index].removeAttribute('readonly');
inputsForRename[index].value = oldName; inputsForRename[index].value = oldName;
@ -44,7 +43,7 @@ export function renameSection() {
body: JSON.stringify({ body: JSON.stringify({
label: newLabel, label: newLabel,
section_id: sectionId, section_id: sectionId,
csrf_token: scrfInput.value, csrf_token: scrfInput ? scrfInput.value : '',
}), }),
}); });
if (response.status == 200) { if (response.status == 200) {

View File

@ -44,7 +44,7 @@ export function renameSubCollection() {
}, },
body: JSON.stringify({ body: JSON.stringify({
label: newLabel, label: newLabel,
csrf_token: scrfInput.value, csrf_token: scrfInput ? scrfInput.value : '',
}), }),
}); });
if (response.status == 200) { if (response.status == 200) {