Check for existing bookmarks

This commit is contained in:
eikek
2022-01-08 22:42:30 +01:00
parent a50a0a9a1a
commit 04b258689f
4 changed files with 103 additions and 8 deletions

View File

@ -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