SearchMenu uses query string instead of json form

This commit is contained in:
Eike Kettner
2021-03-01 17:01:18 +01:00
parent f8307f77c6
commit 889e4f4fb0
7 changed files with 305 additions and 95 deletions

View File

@ -1696,22 +1696,22 @@ itemIndexSearch flags query receive =
}
itemSearch : Flags -> ItemSearch -> (Result Http.Error ItemLightList -> msg) -> Cmd msg
itemSearch : Flags -> ItemQuery -> (Result Http.Error ItemLightList -> msg) -> Cmd msg
itemSearch flags search receive =
Http2.authPost
{ url = flags.config.baseUrl ++ "/api/v1/sec/item/searchFormWithTags"
{ url = flags.config.baseUrl ++ "/api/v1/sec/item/search"
, account = getAccount flags
, body = Http.jsonBody (Api.Model.ItemSearch.encode search)
, body = Http.jsonBody (Api.Model.ItemQuery.encode search)
, expect = Http.expectJson receive Api.Model.ItemLightList.decoder
}
itemSearchStats : Flags -> ItemSearch -> (Result Http.Error SearchStats -> msg) -> Cmd msg
itemSearchStats : Flags -> ItemQuery -> (Result Http.Error SearchStats -> msg) -> Cmd msg
itemSearchStats flags search receive =
Http2.authPost
{ url = flags.config.baseUrl ++ "/api/v1/sec/item/searchFormStats"
{ url = flags.config.baseUrl ++ "/api/v1/sec/item/searchStats"
, account = getAccount flags
, body = Http.jsonBody (Api.Model.ItemSearch.encode search)
, body = Http.jsonBody (Api.Model.ItemQuery.encode search)
, expect = Http.expectJson receive Api.Model.SearchStats.decoder
}