Commit 0785cb94 authored by M. Hamza's avatar M. Hamza
Browse files

fix formatting of vis.go in meep-vis

parent a3534405
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -771,8 +771,6 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) {
			return
		}

		v2xSubscription.Links = link

		// Validating mandatory parameters provided in the request body
		if v2xSubscription.SubscriptionType == "" {
			log.Error("Mandatory SubscriptionType parameter should be present")
@@ -780,6 +778,12 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) {
			return
		}

		if v2xSubscription.Links != nil {
			log.Error("Links attribute should not be present in request body")
			errHandlerProblemDetails(w, "Links attribute should not be present in request body.", http.StatusBadRequest)
			return
		}

		if v2xSubscription.SubscriptionType != "V2xMsgSubscription" {
			log.Error("SubscriptionType should be set to V2xMsgSubscription")
			errHandlerProblemDetails(w, "SubscriptionType should be set to V2xMsgSubscription in the request body.", http.StatusBadRequest)
@@ -798,12 +802,6 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) {
			return
		}

		if v2xSubscription.Links != nil {
			log.Error("Links attribute should not be present in request body")
			errHandlerProblemDetails(w, "Links attribute should not be present in request body.", http.StatusBadRequest)
			return
		}

		for _, msgTypeString := range v2xSubscription.FilterCriteria.MsgType {
			msgTypeInt, _ := strconv.Atoi(msgTypeString)
			if msgTypeInt < 1 && msgTypeInt > 255 {
@@ -813,6 +811,8 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) {
			}
		}

		v2xSubscription.Links = link

		registerV2xSub(&v2xSubscription, subsIdStr)

		_ = rc.JSONSetEntry(baseKey+"subscriptions:"+subsIdStr, ".", convertV2xMsgSubscriptionToJson(&v2xSubscription))