mirror of
https://github.com/thomiceli/opengist.git
synced 2025-01-08 17:42:40 +00:00
Various bug fixes (#105)
This commit is contained in:
parent
a5ea522e45
commit
9dff67f003
2 changed files with 3 additions and 2 deletions
|
@ -377,7 +377,6 @@ func (gist *Gist) UpdatePreviewAndCount() error {
|
||||||
gist.Preview = file.Content
|
gist.Preview = file.Content
|
||||||
}
|
}
|
||||||
|
|
||||||
gist.Preview = file.Content
|
|
||||||
gist.PreviewFilename = file.Filename
|
gist.PreviewFilename = file.Filename
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,9 @@ const setSetting = (key: string, value: string) => {
|
||||||
const data = new URLSearchParams();
|
const data = new URLSearchParams();
|
||||||
data.append('key', key);
|
data.append('key', key);
|
||||||
data.append('value', value);
|
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', {
|
return fetch('/admin-panel/set-config', {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
credentials: 'same-origin',
|
credentials: 'same-origin',
|
||||||
|
|
Loading…
Reference in a new issue