Use search stats to populate search menu

This commit is contained in:
eikek
2021-10-05 10:27:21 +02:00
parent e52271f9cd
commit e961a5ac10
14 changed files with 257 additions and 55 deletions

View File

@ -9,6 +9,7 @@ module Page.Share.Data exposing (Mode(..), Model, Msg(..), PageError(..), init)
import Api
import Api.Model.ItemLightList exposing (ItemLightList)
import Api.Model.SearchStats exposing (SearchStats)
import Api.Model.ShareSecret exposing (ShareSecret)
import Api.Model.ShareVerifyResult exposing (ShareVerifyResult)
import Comp.ItemCardList
@ -41,7 +42,6 @@ type alias Model =
, verifyResult : ShareVerifyResult
, passwordModel : PasswordModel
, pageError : PageError
, items : ItemLightList
, searchMenuModel : Comp.SearchMenu.Model
, powerSearchInput : Comp.PowerSearchInput.Model
, searchInProgress : Bool
@ -58,7 +58,6 @@ emptyModel flags =
, passwordFailed = False
}
, pageError = PageErrorNone
, items = Api.Model.ItemLightList.empty
, searchMenuModel = Comp.SearchMenu.init flags
, powerSearchInput = Comp.PowerSearchInput.init
, searchInProgress = False
@ -79,6 +78,7 @@ init shareId flags =
type Msg
= VerifyResp (Result Http.Error ShareVerifyResult)
| SearchResp (Result Http.Error ItemLightList)
| StatsResp (Result Http.Error SearchStats)
| SetPassword String
| SubmitPassword
| SearchMenuMsg Comp.SearchMenu.Msg