mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-05-09 11:42:57 +00:00
17 lines
331 B
JavaScript
17 lines
331 B
JavaScript
import { fetchURL, fetchJSON } from './utils'
|
|
|
|
export function get () {
|
|
return fetchJSON(`/api/settings`, {})
|
|
}
|
|
|
|
export async function update (settings) {
|
|
const res = await fetchURL(`/api/settings`, {
|
|
method: 'PUT',
|
|
body: JSON.stringify(settings)
|
|
})
|
|
|
|
if (res.status !== 200) {
|
|
throw new Error(res.status)
|
|
}
|
|
}
|