mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
add comments
This commit is contained in:
@@ -40,14 +40,14 @@ class HttpEndpoint {
|
|||||||
if (request->method() == HTTP_POST) {
|
if (request->method() == HTTP_POST) {
|
||||||
// Handle POST
|
// Handle POST
|
||||||
if (!json.is<JsonObject>()) {
|
if (!json.is<JsonObject>()) {
|
||||||
request->send(400);
|
request->send(400); // error, bad request
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
StateUpdateResult outcome = _statefulService->updateWithoutPropagation(json.as<JsonObject>(), _stateUpdater);
|
StateUpdateResult outcome = _statefulService->updateWithoutPropagation(json.as<JsonObject>(), _stateUpdater);
|
||||||
|
|
||||||
if (outcome == StateUpdateResult::ERROR) {
|
if (outcome == StateUpdateResult::ERROR) {
|
||||||
request->send(400); // error
|
request->send(400); // error, bad request
|
||||||
return;
|
return;
|
||||||
} else if (outcome == StateUpdateResult::CHANGED || outcome == StateUpdateResult::CHANGED_RESTART) {
|
} else if (outcome == StateUpdateResult::CHANGED || outcome == StateUpdateResult::CHANGED_RESTART) {
|
||||||
// persist changes
|
// persist changes
|
||||||
|
|||||||
Reference in New Issue
Block a user