Skip to content
Snippets Groups Projects
Commit 9b3427d8 authored by Francé Wilke's avatar Francé Wilke
Browse files

API Logs - fix handler crash, revert limit and offset for order search

parent 1518cf7c
No related branches found
No related tags found
No related merge requests found
......@@ -113,11 +113,15 @@ func GenerateOutgoingAPILog(startTime time.Time, requestID *string, claim map[st
providerID, _ := claim["ProviderID"].(int64)
params := map[string]string{}
path := ""
address := ""
parsedURL, err := url.Parse(urlString)
if err == nil {
for n, v := range parsedURL.Query() {
params[n] = strings.Join(v, ",")
}
path = parsedURL.Path
address = parsedURL.Host
}
typeString := "api-outgoing"
......@@ -131,8 +135,8 @@ func GenerateOutgoingAPILog(startTime time.Time, requestID *string, claim map[st
DurMs: endTime.Sub(startTime).Milliseconds(),
Type: typeString,
Method: method,
Path: parsedURL.Path,
Address: parsedURL.Host,
Path: path,
Address: address,
ResponseCode: responseCode,
RequestID: currentRequestID,
UserID: userID,
......
......@@ -142,7 +142,7 @@ func (ds *DocumentStore) Write(id string, data interface{}) error {
// Search
// Return:
// docs will be a slice of the DocumentStore data type
func (ds *DocumentStore) Search(query Query, sort []map[string]string, limit int64, offset int64) (res *SearchResponseHits, err error) {
func (ds *DocumentStore) Search(query Query, limit int64) (res *SearchResponseHits, err error) {
if ds == nil {
return nil, errors.Errorf("document store == nil")
}
......@@ -162,9 +162,7 @@ func (ds *DocumentStore) Search(query Query, sort []map[string]string, limit int
// }
// }
body := SearchRequestBody{
Sort: sort,
Size: limit,
From: offset,
Query: query,
Timeout: Timeout,
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment