logs fix
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
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())
|
||||
}
|
||||
|
||||
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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user