Commit fd031792 authored by M. Rehan Abbasi's avatar M. Rehan Abbasi
Browse files

modify check for two or more routeInfo in a route in VIS

parent 4a234e9e
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -634,11 +634,6 @@ func predictedQosPost(w http.ResponseWriter, r *http.Request) {
		return
	}

	if len(requestData.Routes) < 2 {
		log.Error("At least two routes are required")
		http.Error(w, "At least two routes are required", http.StatusBadRequest)
	}

	responseData := requestData // Both reqesut and response have same data model

	for i, route := range requestData.Routes {
@@ -648,6 +643,12 @@ func predictedQosPost(w http.ResponseWriter, r *http.Request) {
			return
		}

		if len(route.RouteInfo) < 2 {
			log.Error("At least two routeInfo required in a route")
			http.Error(w, "At least two routeInfo required in a route", http.StatusBadRequest)
			return
		}

		var geocoordinates []gisClient.GeoCoordinate
		for _, routeInfo := range route.RouteInfo {
			if routeInfo.Location == nil {