Implement get config command and api endpoint for testing purposes

This commit is contained in:
Lorow
2024-12-05 00:40:06 +01:00
parent e033f663ff
commit 44179cee65
8 changed files with 48 additions and 2 deletions

View File

@@ -121,7 +121,8 @@ void RestAPI::handle_update_camera(RequestContext *context)
void RestAPI::handle_get_config(RequestContext *context)
{
mg_http_reply(context->connection, 200, JSON_RESPONSE, "{%m:%m}", MG_ESC("result"), "Device config updated");
auto result = this->command_manager->executeFromType(CommandType::GET_CONFIG, "");
mg_http_reply(context->connection, 200, JSON_RESPONSE, "{%m:%m}", MG_ESC("result"), result.getResult());
}
// resets