fixed typo "values"

This commit is contained in:
Emanuele Trabattoni
2025-08-01 10:38:29 +02:00
parent abe0cb0839
commit eaa643bf3c

View File

@@ -74,13 +74,13 @@ namespace commands
const auto &eventName = params["name"].as<std::string>();
const auto &timeStr = params["cronExpr"].as<std::string>();
const auto &actionStr = params["action"].as<std::string>();
response["value"]["name"] = eventName;
response["values"]["name"] = eventName;
ArduinoJson::JsonDocument action;
if (ArduinoJson::deserializeJson(action, actionStr) != ArduinoJson::DeserializationError::Ok)
{
LOG_ERROR("setCronJob unable to deserialize cron job [", actionStr.c_str(), "]");
response["value"]["status"] = "invalid";
response["values"]["status"] = "invalid";
return response;
}
@@ -88,11 +88,11 @@ namespace commands
if (!cron.addEvent(eventName, timeStr, action))
{
LOG_ERROR("setCronJob unable to add job [", actionStr.c_str(), "]");
response["value"]["status"] = "invalid";
response["values"]["status"] = "invalid";
return response;
}
LOG_INFO("setCronJob added job [", actionStr.c_str(), "]");
response["value"]["status"] = "valid";
response["values"]["status"] = "valid";
return response;
}
const ArduinoJson::JsonDocument Commands::getCronJob(const devices_t &dev, const ArduinoJson::JsonDocument &params)