From 3113d392ac5e896efdeb6cdb4ce05d15192dee99 Mon Sep 17 00:00:00 2001 From: Proddy Date: Mon, 11 Oct 2021 16:41:44 +0200 Subject: [PATCH] minor text changes --- src/web/WebAPIService.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/web/WebAPIService.cpp b/src/web/WebAPIService.cpp index 274b164de..bfd923025 100644 --- a/src/web/WebAPIService.cpp +++ b/src/web/WebAPIService.cpp @@ -162,14 +162,13 @@ void WebAPIService::parse(AsyncWebServerRequest * request, std::string & device_ } } - // now go and verify the values - - // device check + // device checks if (device_s.empty()) { // see if we have a device embedded in the json body, then use that send_message_response(request, 422, "Missing device"); // Unprocessable Entity return; } + device_type = EMSdevice::device_name_2_device_type(device_s.c_str()); if (device_type == EMSdevice::DeviceType::UNKNOWN) { send_message_response(request, 422, "Invalid call"); // Unprocessable Entity @@ -182,6 +181,7 @@ void WebAPIService::parse(AsyncWebServerRequest * request, std::string & device_ auto method = request->method(); bool have_data = !value_s.empty(); bool authenticated = false; + EMSESP::webSettingsService.read([&](WebSettings & settings) { Authentication authentication = _securityManager->authenticateRequest(request); authenticated = settings.notoken_api | AuthenticationPredicates::IS_ADMIN(authentication); @@ -252,7 +252,7 @@ void WebAPIService::send_message_response(AsyncWebServerRequest * request, uint1 request->send(response); } - EMSESP::logger().debug(F("API returns, code: %d, message: %s"), error_code, error_message); + EMSESP::logger().debug(F("API return code: %d, message: %s"), error_code, error_message); } /**