From 74ef924fea55c4adab51ddae4541fd9a4465627b Mon Sep 17 00:00:00 2001 From: Duc Ha <44975410+GitAYYYer@users.noreply.github.com> Date: Thu, 2 Jun 2022 23:21:14 +1000 Subject: [PATCH] Fixed from credenitals to credentials (#9) --- components/svelte-portal/src/App.svelte | 4 ++-- main/network-http.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/svelte-portal/src/App.svelte b/components/svelte-portal/src/App.svelte index 3ca3d05..f81fa67 100644 --- a/components/svelte-portal/src/App.svelte +++ b/components/svelte-portal/src/App.svelte @@ -50,7 +50,7 @@ popup_message_text = ""; popup_message.show(); - await api_post(server + "/api/v1/wifi/set_credenitals", { + await api_post(server + "/api/v1/wifi/set_credentials", { wifi_mode: mode_select.get_value(), ap_ssid: ap_ssid_input.get_value(), ap_pass: ap_pass_input.get_value(), @@ -134,7 +134,7 @@ {#if current_tab == "WiFi"}
- {#await api_get(server + "/api/v1/wifi/get_credenitals")} + {#await api_get(server + "/api/v1/wifi/get_credentials")}
Mode:
SSID:
diff --git a/main/network-http.c b/main/network-http.c index 2a22b6d..58948fc 100644 --- a/main/network-http.c +++ b/main/network-http.c @@ -296,7 +296,7 @@ static esp_err_t system_info_get_handler(httpd_req_t* req) { return ESP_OK; } -static esp_err_t wifi_get_credenitals_handler(httpd_req_t* req) { +static esp_err_t wifi_get_credentials_handler(httpd_req_t* req) { httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); httpd_resp_set_type(req, "application/json"); cJSON* root = cJSON_CreateObject(); @@ -338,7 +338,7 @@ static esp_err_t wifi_get_credenitals_handler(httpd_req_t* req) { return ESP_OK; } -static esp_err_t wifi_set_credenitals_handler(httpd_req_t* req) { +static esp_err_t wifi_set_credentials_handler(httpd_req_t* req) { httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); int total_length = req->content_len; int cur_len = 0; @@ -605,14 +605,14 @@ const httpd_uri_t uri_handlers[] = { .handler = wifi_list_get_handler, .user_ctx = NULL}, - {.uri = "/api/v1/wifi/set_credenitals", + {.uri = "/api/v1/wifi/set_credentials", .method = HTTP_POST, - .handler = wifi_set_credenitals_handler, + .handler = wifi_set_credentials_handler, .user_ctx = NULL}, - {.uri = "/api/v1/wifi/get_credenitals", + {.uri = "/api/v1/wifi/get_credentials", .method = HTTP_GET, - .handler = wifi_get_credenitals_handler, + .handler = wifi_get_credentials_handler, .user_ctx = NULL}, /*************** HTTP ***************/