mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2025-01-03 08:13:49 +01:00
return substituted ssid on save settings response
This commit is contained in:
parent
e87641d76a
commit
b5465a43fd
@ -3,6 +3,7 @@ local utils = require('util.utils')
|
||||
local settings = require('util.settings')
|
||||
local printer = require('util.printer')
|
||||
local signin = require('network.signin')
|
||||
local wifi = require('network.wlanconfig')
|
||||
|
||||
local M = {
|
||||
isApi = true
|
||||
@ -22,17 +23,25 @@ end
|
||||
function M._global_POST(request, response)
|
||||
--log:info("API:config:set")
|
||||
response:setSuccess()
|
||||
|
||||
local validation = {}
|
||||
for k,v in pairs(request:getAll()) do
|
||||
--log:info(" "..k..": "..v);
|
||||
local r,m = settings.set(k, v)
|
||||
|
||||
if r then
|
||||
response:addData(k, "ok")
|
||||
--response:addData(k, "ok")
|
||||
validation[k] = "ok"
|
||||
else
|
||||
response:addData(k, "could not save setting ('" .. m .. "')")
|
||||
--response:addData(k, "could not save setting ('" .. m .. "')")
|
||||
validation[k] = "could not save setting ('" .. m .. "')"
|
||||
log:info(" m: "..utils.dump(m))
|
||||
end
|
||||
end
|
||||
response:addData("validation",validation)
|
||||
|
||||
local substitutedSsid = wifi.getSubstitutedSsid(settings.get('network.ap.ssid'))
|
||||
response:addData("substituted_ssid",substitutedSsid)
|
||||
|
||||
log:info("API:Network:try signing in")
|
||||
if signin.signin() then
|
||||
|
Loading…
Reference in New Issue
Block a user