Various bug fixes (#105)

This commit is contained in:
Thomas Miceli
2023-09-22 17:31:19 +02:00
committed by GitHub
parent a5ea522e45
commit 9dff67f003
2 changed files with 3 additions and 2 deletions

View File

@ -11,7 +11,9 @@ const setSetting = (key: string, value: string) => {
const data = new URLSearchParams();
data.append('key', key);
data.append('value', value);
data.append('_csrf', ((document.getElementsByName('_csrf')[0] as HTMLInputElement).value));
if (document.getElementsByName('_csrf').length !== 0) {
data.append('_csrf', ((document.getElementsByName('_csrf')[0] as HTMLInputElement).value));
}
return fetch('/admin-panel/set-config', {
method: 'PUT',
credentials: 'same-origin',