diff --git a/pkg/api/apiCall.go b/pkg/api/apiCall.go index 39af217..9e7a6b0 100644 --- a/pkg/api/apiCall.go +++ b/pkg/api/apiCall.go @@ -20,10 +20,8 @@ func PostRequest(url string, model any, header http.Header, c echo.Context) ([]b req.Header = header req.Header.Set("Content-Type", "application/json") - if err != nil { - c.Logger().Debug("Request---") - c.Logger().Debug(string(uJson)) - } + c.Logger().Debug("Request---") + c.Logger().Debug(string(uJson)) resp, err := client.Do(req) @@ -39,7 +37,7 @@ func PostRequest(url string, model any, header http.Header, c echo.Context) ([]b debug, err := json.Marshal(resp.Body) - if err != nil { + if err == nil { c.Logger().Debug("Response---") c.Logger().Debug(string(debug)) } @@ -56,10 +54,8 @@ func GetRequest(url string, header http.Header, c echo.Context, args ...string) req.Header = header req.Header.Set("Content-Type", "application/json") - if err != nil { - c.Logger().Debug("Request---") - c.Logger().Debug(req.URL.String()) - } + c.Logger().Debug("Request---") + c.Logger().Debug(req.URL.String()) resp, err := client.Do(req) @@ -75,7 +71,7 @@ func GetRequest(url string, header http.Header, c echo.Context, args ...string) debug, err := json.Marshal(resp.Body) - if err != nil { + if err == nil { c.Logger().Debug("Response---") c.Logger().Debug(string(debug)) }