Commit 3887c4b2 authored by Mubeena Ishaq's avatar Mubeena Ishaq
Browse files

fix conditions for PUT method in meep-vis

parent c89a47ca
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -1330,21 +1330,21 @@ func individualSubscriptionPut(w http.ResponseWriter, r *http.Request) {
			return
		}

		if subscription.FilterCriteria.StdOrganization == "" {
			log.Error("Mandatory StdOrganization parameter should be present")
			errHandlerProblemDetails(w, "Mandatory attribute StdOrganization is missing in the request body.", http.StatusBadRequest)
		if subscription.CallbackReference == "" && subscription.WebsockNotifConfig.WebsocketUri == "" {
			log.Error("At least one of callbackReference and websockNotifConfig parameters should be present")
			errHandlerProblemDetails(w, "At least one of callbackReference and websockNotifConfig parameters should be present.", http.StatusBadRequest)
			return
		}

		if subscription.FilterCriteria == nil {
			log.Error("FilterCriteria should not be null for this subscription type")
			log.Error("Mandatory attribute FilterCriteria is missing for this subscription type")
			errHandlerProblemDetails(w, "Mandatory attribute FilterCriteria is missing for this subscription type", http.StatusBadRequest)
			return
		}

		if subscription.CallbackReference == "" && subscriptionCommon.WebsockNotifConfig.WebsocketUri == "" {
			log.Error("At least one of CallbackReference and WebsockNotifConfig parameters should be present")
			errHandlerProblemDetails(w, "At least one of CallbackReference and WebsockNotifConfig parameters should be present.", http.StatusBadRequest)
		if subscription.FilterCriteria.StdOrganization == "" {
			log.Error("Mandatory StdOrganization parameter should be present")
			errHandlerProblemDetails(w, "Mandatory attribute StdOrganization is missing in the request body.", http.StatusBadRequest)
			return
		}