mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +00:00
api cleanup for setting open access
This commit is contained in:
parent
cee9612fc0
commit
cd2501dc4b
@ -123,12 +123,12 @@ paths:
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: update
|
||||
- name: setOpenAccess
|
||||
in: query
|
||||
description: if open access should be updated
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
type: boolean
|
||||
responses:
|
||||
'200':
|
||||
description: success
|
||||
|
@ -17,7 +17,7 @@ func SetNodeConfig(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
// update open access
|
||||
updateAccess := r.FormValue("update") == "open"
|
||||
updateAccess := r.FormValue("setOpenAccess") == "true"
|
||||
|
||||
// parse node config
|
||||
var config NodeConfig
|
||||
|
@ -2,7 +2,7 @@ import { checkResponse, fetchWithTimeout } from './fetchUtil';
|
||||
|
||||
export async function setNodeConfig(token, config) {
|
||||
let body = JSON.stringify(config);
|
||||
let settings = await fetchWithTimeout(`/admin/config?update=open&token=${token}`, { method: 'PUT', body });
|
||||
let settings = await fetchWithTimeout(`/admin/config?setOpenAccess=true&token=${token}`, { method: 'PUT', body });
|
||||
checkResponse(settings);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user