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