Skip to content

Commit

Permalink
Merge pull request #124 from TheCacophonyProject/tc2-new
Browse files Browse the repository at this point in the history
Fixes previous PR change with GetWifiNetworks input
  • Loading branch information
Zainrax authored Feb 26, 2024
2 parents 37e4f6d + a87b1e0 commit e3dabd3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,6 @@ func CheckInternetConnection(interfaceName string) bool {
return false
}
return true

}

func (api *ManagementAPI) CheckModemInternetConnection(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -1319,7 +1318,6 @@ func (api *ManagementAPI) SaveWifiNetwork(w http.ResponseWriter, r *http.Request
}

scanWifis, err := netmanagerclient.ScanWiFiNetworks()

if err != nil {
log.Printf("Error scanning Wi-Fi networks: %v", err)
http.Error(w, "Failed to scan Wi-Fi networks: "+err.Error(), http.StatusInternalServerError)
Expand Down Expand Up @@ -1359,7 +1357,7 @@ func (api *ManagementAPI) SaveWifiNetwork(w http.ResponseWriter, r *http.Request
}

func (api *ManagementAPI) GetSavedWifiNetworks(w http.ResponseWriter, r *http.Request) {
networks, err := netmanagerclient.ListSavedWifiNetworks()
networks, err := netmanagerclient.ListUserSavedWifiNetworks()
if err != nil {
serverError(&w, err)
return
Expand Down
2 changes: 1 addition & 1 deletion cmd/managementd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func main() {
apiRouter.HandleFunc("/test-videos", apiObj.GetTestVideos).Methods("GET")
apiRouter.HandleFunc("/play-test-video", apiObj.PlayTestVideo).Methods("POST")
apiRouter.HandleFunc("/network/interfaces", apiObj.GetNetworkInterfaces).Methods("GET")
apiRouter.HandleFunc("/network/wifi", apiObj.GetWifiNetworks).Methods("GET")
apiRouter.HandleFunc("/network/wifi", apiObj.ScanWifiNetwork).Methods("GET")
apiRouter.HandleFunc("/network/wifi", apiObj.ConnectToWifi).Methods("POST")
apiRouter.HandleFunc("/network/wifi/save", apiObj.SaveWifiNetwork).Methods("POST")
apiRouter.HandleFunc("/network/wifi/saved", apiObj.GetSavedWifiNetworks).Methods("GET")
Expand Down

0 comments on commit e3dabd3

Please sign in to comment.