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

View File

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

View File

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