event table device-dashboard: fixed wrong api call

This commit is contained in:
robert committed 2023-06-26 10:31:55 -04:00
1 parent fa8490fb4e
commit 427f95337f
2 files changed
+10 -31

No files matched your search

+3 -3
View File
@@ -180,7 +180,7 @@ static size_t print_events(void (*out)(char, void *), void *ptr, va_list *ap) {
return len;
}
static void handle_events_set(struct mg_connection *c, struct mg_http_message *hm) {
static void handle_events_get(struct mg_connection *c, struct mg_http_message *hm) {
int pageno = mg_json_get_long(hm->body, "$.page", 1);
mg_http_reply(c, 200, s_json_header, "{%m:[%M], %m:%d}", MG_ESC("arr"),
print_events, pageno, MG_ESC("totalCount"), MAX_EVENTS_NO);
@@ -237,8 +237,8 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
handle_debug(c, hm);
} else if (mg_http_match_uri(hm, "/api/stats/get")) {
handle_stats_get(c);
} else if (mg_http_match_uri(hm, "/api/events/set")) {
handle_events_set(c, hm);
} else if (mg_http_match_uri(hm, "/api/events/get")) {
handle_events_get(c, hm);
} else if (mg_http_match_uri(hm, "/api/settings/get")) {
handle_settings_get(c);
} else if (mg_http_match_uri(hm, "/api/settings/set")) {