add: macro endpoint for execution

This commit is contained in:
Tobias Reisinger 2020-09-06 13:12:33 +02:00
parent 01ffb1d58d
commit d3fd48b35a
9 changed files with 110 additions and 26 deletions
src/endpoints

View file

@ -86,11 +86,11 @@ api_v1_macros_STR_PUT(struct mg_connection *nc, struct http_message *hm, endpoin
}
}
macro_action_delete_for_macro(macro->id);
cJSON *json_actions = cJSON_GetObjectItemCaseSensitive(json, "actions");
if(cJSON_IsArray(json_actions))
{
macro_action_delete_for_macro(macro->id);
cJSON *json_action;
cJSON_ArrayForEach(json_action, json_actions)
{