Skip to content

Commit

Permalink
mathieucarbou/MycilaConfig @ 6.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieucarbou committed Nov 12, 2024
1 parent 1cd8253 commit 056a9fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ lib_deps =
mathieucarbou/AsyncTCP @ 3.2.14
; https://github.com/mathieucarbou/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip
mathieucarbou/ESPAsyncWebServer @ 3.3.22
mathieucarbou/MycilaConfig @ 5.0.0
mathieucarbou/MycilaConfig @ 6.0.1
mathieucarbou/MycilaDS18 @ 4.1.0
mathieucarbou/MycilaESPConnect @ 6.1.1
mathieucarbou/MycilaEasyDisplay @ 3.0.2
Expand Down
5 changes: 3 additions & 2 deletions src/init/REST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <YaSolRWebsite.h>

#include <map>
#include <string>

Mycila::Task initRestApiTask("Init REST API", [](void* params) {
logger.info(TAG, "Initializing REST API");
Expand Down Expand Up @@ -168,12 +169,12 @@ Mycila::Task initRestApiTask("Init REST API", [](void* params) {

webServer
.on("/api/config", HTTP_POST, [](AsyncWebServerRequest* request) {
std::map<const char*, String> settings;
std::map<const char*, std::string> settings;
for (size_t i = 0, max = request->params(); i < max; i++) {
const AsyncWebParameter* p = request->getParam(i);
if (p->isPost() && !p->isFile()) {
const char* keyRef = config.keyRef(p->name().c_str());
settings[keyRef] = p->value();
settings[keyRef] = p->value().c_str();
}
}
request->send(200);
Expand Down

0 comments on commit 056a9fe

Please sign in to comment.