Update search to use v2 API endpoint
v1 has been disabled on most instances by now. The change is minor: hash-tags are now reported as proper structs instead of a simple string-array.
This commit is contained in:
parent
021f5d0019
commit
75578dd249
5 changed files with 9 additions and 9 deletions
|
@ -13,8 +13,8 @@ func TestCmdSearch(t *testing.T) {
|
|||
out := testWithServer(
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.URL.Path {
|
||||
case "/api/v1/search":
|
||||
fmt.Fprintln(w, `{"accounts": [{"id": 234, "acct": "zzz"}], "statuses":[{"id": 345, "content": "yyy"}], "hashtags": ["www", "わろす"]}`)
|
||||
case "/api/v2/search":
|
||||
fmt.Fprintln(w, `{"accounts": [{"id": 234, "acct": "zzz"}], "statuses":[{"id": 345, "content": "yyy"}], "hashtags": [{"name": "www"}, {"name": "わろす"}]}`)
|
||||
return
|
||||
}
|
||||
http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue