Some changes
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 24s

This commit is contained in:
2025-06-01 12:04:24 -04:00
parent ef145bdf9a
commit b477017411
4 changed files with 20 additions and 23 deletions

View File

@ -434,7 +434,6 @@ func (c *Client) execute(requestUrl string, method string, params map[string]str
// GET Requests
if method == "GET" {
resp, _ = c.httpClient.
// SetBaseURL(MOBILE_API_SERVER[c.country]).
R().
SetQueryParams(params).
Get(requestUrl)
@ -467,9 +466,7 @@ func (c *Client) execute(requestUrl string, method string, params map[string]str
c.logger.Error("error while parsing json", "request", "execute", "method", method, "url", requestUrl, "error", err.Error())
}
if !r.Success {
c.logger.Error("request is not successfull", "request", "execute", "method", method, "url", requestUrl, "error", err.Error())
} else {
if r.Success {
var sr ServiceRequest
err := json.Unmarshal(r.Data, &sr)
if err != nil {
@ -485,7 +482,7 @@ func (c *Client) execute(requestUrl string, method string, params map[string]str
SetBaseURL(MOBILE_API_SERVER[c.country]).
R().
SetQueryParams(map[string]string{
"serviceRequestId": *sr.ServiceRequestID,
"serviceRequestId": sr.ServiceRequestID,
}).
Get(pollingUrl)
resBytes, _ := io.ReadAll(resp.Body)
@ -519,7 +516,8 @@ func (c *Client) execute(requestUrl string, method string, params map[string]str
time.Sleep(3 * time.Second)
}
}
} else {
c.logger.Error("request is not successfull", "request", "execute", "method", method, "url", requestUrl, "error", err.Error())
}
return resBytes