mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 18:38:26 +00:00
Add new search-index route to web-ui
This commit is contained in:
@ -45,6 +45,7 @@ module Api exposing
|
||||
, getTags
|
||||
, getUsers
|
||||
, itemDetail
|
||||
, itemIndexSearch
|
||||
, itemSearch
|
||||
, login
|
||||
, loginSession
|
||||
@ -104,6 +105,7 @@ import Api.Model.ImapSettings exposing (ImapSettings)
|
||||
import Api.Model.ImapSettingsList exposing (ImapSettingsList)
|
||||
import Api.Model.InviteResult exposing (InviteResult)
|
||||
import Api.Model.ItemDetail exposing (ItemDetail)
|
||||
import Api.Model.ItemFtsSearch exposing (ItemFtsSearch)
|
||||
import Api.Model.ItemInsights exposing (ItemInsights)
|
||||
import Api.Model.ItemLightList exposing (ItemLightList)
|
||||
import Api.Model.ItemProposals exposing (ItemProposals)
|
||||
@ -1092,6 +1094,20 @@ moveAttachmentBefore flags itemId data receive =
|
||||
}
|
||||
|
||||
|
||||
itemIndexSearch :
|
||||
Flags
|
||||
-> ItemFtsSearch
|
||||
-> (Result Http.Error ItemLightList -> msg)
|
||||
-> Cmd msg
|
||||
itemIndexSearch flags query receive =
|
||||
Http2.authPost
|
||||
{ url = flags.config.baseUrl ++ "/api/v1/sec/item/searchIndex"
|
||||
, account = getAccount flags
|
||||
, body = Http.jsonBody (Api.Model.ItemFtsSearch.encode query)
|
||||
, expect = Http.expectJson receive Api.Model.ItemLightList.decoder
|
||||
}
|
||||
|
||||
|
||||
itemSearch : Flags -> ItemSearch -> (Result Http.Error ItemLightList -> msg) -> Cmd msg
|
||||
itemSearch flags search receive =
|
||||
Http2.authPost
|
||||
|
Reference in New Issue
Block a user