api cleanup for setting open access

This commit is contained in:
Roland Osborne 2023-07-18 12:05:35 -07:00
parent cee9612fc0
commit cd2501dc4b
3 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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);
}