Skip to content

Commit

Permalink
fix search name_id cast
Browse files Browse the repository at this point in the history
  • Loading branch information
stelzo committed Nov 30, 2024
1 parent 31bb7a4 commit b3372dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1158,9 +1158,7 @@ func SearchAllIndices(w http.ResponseWriter, r *http.Request) {
for _, hit := range searchResp.Hits {
indexed := hit.(map[string]interface{})

stuffType := indexed["stuff_type"].(struct {
NameId string `json:"name_id"`
}).NameId
stuffType := indexed["stuff_type"].(map[string]interface{})["name_id"].(string)

isItem := strings.HasPrefix(stuffType, "items-")
ankamaId := int(indexed["id"].(float64))
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

var (
DoduapiMajor = 1 // Major version also used for prefixing API routes.
DoduapiVersion = fmt.Sprintf("v%d.0.0-rc.1", DoduapiMajor) // change with every release
DoduapiVersion = fmt.Sprintf("v%d.0.0-rc.4", DoduapiMajor) // change with every release
DoduapiShort = "doduapi - Open Dofus Encyclopedia API"
DoduapiLong = ""
DoduapiVersionHelp = DoduapiShort + "\n" + DoduapiVersion + "\nhttps://github.com/dofusdude/doduapi"
Expand Down

0 comments on commit b3372dd

Please sign in to comment.