Commit b1f2b606 authored by Ikram Haq's avatar Ikram Haq
Browse files

Remove unnecessary code

parent cfa7f10e
Loading
Loading
Loading
Loading
+0 −63
Original line number Diff line number Diff line
@@ -1832,69 +1832,6 @@ func apByIdGet(w http.ResponseWriter, r *http.Request) {
	fmt.Fprint(w, string(jsonResponse))
}

// func zonesGet(w http.ResponseWriter, r *http.Request) {
// 	w.Header().Set("Content-Type", "application/json; charset=UTF-8")

// 	// Check if zoneId query parameter is provided
// 	zoneID := r.URL.Query().Get("zoneId")
// 	if zoneID != "" {
// 		// If zoneId is provided, retrieve information for that specific zone
// 		var zoneInfo ZoneInfo

// 		// Retrieve zone information from the DB
// 		jsonZoneInfo, _ := rc.JSONGetEntry(baseKey+typeZone+":"+zoneID, ".")
// 		if jsonZoneInfo == "" {
// 			w.WriteHeader(http.StatusNotFound)
// 			return
// 		}

// 		// Unmarshal the retrieved JSON into zoneInfo struct
// 		err := json.Unmarshal([]byte(jsonZoneInfo), &zoneInfo)
// 		if err != nil {
// 			log.Error(err.Error())
// 			errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError)
// 			return
// 		}

// 		// Marshal the zoneInfo into JSON response
// 		jsonResponse, err := json.Marshal(InlineZoneInfo{ZoneInfo: &zoneInfo})
// 		if err != nil {
// 			log.Error(err.Error())
// 			errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError)
// 			return
// 		}

// 		w.WriteHeader(http.StatusOK)
// 		fmt.Fprint(w, string(jsonResponse))
// 	} else {
// 		// If zoneId is not provided, retrieve information for all zones
// 		var response InlineZoneList
// 		var zoneList ZoneList
// 		zoneList.ResourceURL = hostUrl.String() + basePath + "queries/zones"
// 		response.ZoneList = &zoneList

// 		// Retrieve zone list information from the DB
// 		keyName := baseKey + typeZone + ":*"
// 		err := rc.ForEachJSONEntry(keyName, populateZoneList, &zoneList)
// 		if err != nil {
// 			log.Error(err.Error())
// 			errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError)
// 			return
// 		}

// 		// Marshal the zoneList into JSON response
// 		jsonResponse, err := json.Marshal(response)
// 		if err != nil {
// 			log.Error(err.Error())
// 			errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError)
// 			return
// 		}

// 		w.WriteHeader(http.StatusOK)
// 		fmt.Fprint(w, string(jsonResponse))
// 	}
// }

func zonesGet(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json; charset=UTF-8")