Skip to content

Commit b3372dd

Browse files
committed
fix search name_id cast
1 parent 31bb7a4 commit b3372dd

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

handler.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1158,9 +1158,7 @@ func SearchAllIndices(w http.ResponseWriter, r *http.Request) {
11581158
for _, hit := range searchResp.Hits {
11591159
indexed := hit.(map[string]interface{})
11601160

1161-
stuffType := indexed["stuff_type"].(struct {
1162-
NameId string `json:"name_id"`
1163-
}).NameId
1161+
stuffType := indexed["stuff_type"].(map[string]interface{})["name_id"].(string)
11641162

11651163
isItem := strings.HasPrefix(stuffType, "items-")
11661164
ankamaId := int(indexed["id"].(float64))

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

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

0 commit comments

Comments
 (0)