Basic search view for shares

This commit is contained in:
eikek
2021-10-05 01:06:52 +02:00
parent a286556116
commit 83dd675e4f
12 changed files with 577 additions and 23 deletions

View File

@ -14,6 +14,7 @@ module Util.Http exposing
, authTask
, executeIn
, jsonResolver
, sharePost
)
import Api.Model.AuthResult exposing (AuthResult)
@ -49,6 +50,28 @@ authReq req =
}
shareReq :
{ url : String
, token : String
, method : String
, headers : List Http.Header
, body : Http.Body
, expect : Http.Expect msg
, tracker : Maybe String
}
-> Cmd msg
shareReq req =
Http.request
{ url = req.url
, method = req.method
, headers = Http.header "Docspell-Share-Auth" req.token :: req.headers
, expect = req.expect
, body = req.body
, timeout = Nothing
, tracker = req.tracker
}
authPost :
{ url : String
, account : AuthResult
@ -68,6 +91,25 @@ authPost req =
}
sharePost :
{ url : String
, token : String
, body : Http.Body
, expect : Http.Expect msg
}
-> Cmd msg
sharePost req =
shareReq
{ url = req.url
, token = req.token
, body = req.body
, expect = req.expect
, method = "POST"
, headers = []
, tracker = Nothing
}
authPostTrack :
{ url : String
, account : AuthResult