mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Check for existing bookmarks
This commit is contained in:
@ -16,6 +16,7 @@ module Api exposing
|
||||
, addTag
|
||||
, addTagsMultiple
|
||||
, attachmentPreviewURL
|
||||
, bookmarkNameExists
|
||||
, cancelJob
|
||||
, changeFolderName
|
||||
, changePassword
|
||||
@ -2371,6 +2372,23 @@ addBookmark flags model receive =
|
||||
Task.andThen add load |> Task.attempt receive
|
||||
|
||||
|
||||
bookmarkNameExistsTask : Flags -> BookmarkLocation -> String -> Task.Task Http.Error Bool
|
||||
bookmarkNameExistsTask flags loc name =
|
||||
let
|
||||
load =
|
||||
getBookmarksTask flags loc
|
||||
|
||||
exists current =
|
||||
Data.BookmarkedQuery.exists name current
|
||||
in
|
||||
Task.map exists load
|
||||
|
||||
|
||||
bookmarkNameExists : Flags -> BookmarkLocation -> String -> (Result Http.Error Bool -> msg) -> Cmd msg
|
||||
bookmarkNameExists flags loc name receive =
|
||||
bookmarkNameExistsTask flags loc name |> Task.attempt receive
|
||||
|
||||
|
||||
|
||||
--- OTP
|
||||
|
||||
|
Reference in New Issue
Block a user