Skip to content

Commit be86fd0

Browse files
committed
take in query param ComparisonRequestDto instead of payload in get req
1 parent a940803 commit be86fd0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

api/restHandler/app/configDiff/DeploymentConfigurationRestHandler.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,13 @@ func (handler *DeploymentConfigurationRestHandlerImpl) CompareCategoryWiseConfig
155155
}
156156
vars := mux.Vars(r)
157157
configCategory := vars["resource"]
158+
159+
v := r.URL.Query()
160+
comparisonReqString := v.Get("compareConfig")
158161
var comparisonRequestDto bean.ComparisonRequestDto
159-
err = json.NewDecoder(r.Body).Decode(&comparisonRequestDto)
162+
err = json.Unmarshal([]byte(comparisonReqString), &comparisonRequestDto)
160163
if err != nil {
161-
handler.logger.Errorw("error in decoding request body", "err", err)
164+
handler.logger.Errorw("error in unmarshalling stringified json query param", "err", err)
162165
common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
163166
return
164167
}

0 commit comments

Comments
 (0)