diff options
author | Yorhel <git@yorhel.nl> | 2020-07-07 09:49:51 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2020-07-07 09:49:51 +0200 |
commit | cbcd0511dd220e456cb56469398fe4b37fbc7951 (patch) | |
tree | cd25c3c3da90ab7bf06c20475e70b595a001d3e7 /elm/Lib/Autocomplete.elm | |
parent | 10bdc72a6e74f53f512f6b7d3b553315354f6585 (diff) |
VN::Edit: Add staff editing
Diffstat (limited to 'elm/Lib/Autocomplete.elm')
-rw-r--r-- | elm/Lib/Autocomplete.elm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/elm/Lib/Autocomplete.elm b/elm/Lib/Autocomplete.elm index 7f44ccae..13aacb5f 100644 --- a/elm/Lib/Autocomplete.elm +++ b/elm/Lib/Autocomplete.elm @@ -9,6 +9,7 @@ module Lib.Autocomplete exposing , traitSource , vnSource , producerSource + , staffSource , charSource , animeSource , init @@ -36,6 +37,7 @@ import Gen.Tags as GT import Gen.Traits as GTR import Gen.VN as GV import Gen.Producers as GP +import Gen.Staff as GS import Gen.Chars as GC import Gen.Anime as GA @@ -149,6 +151,19 @@ producerSource = } +staffSource : SourceConfig m GApi.ApiStaffResult +staffSource = + { source = Endpoint (\s -> GS.send { search = s }) + <| \x -> case x of + GApi.StaffResult e -> Just e + _ -> Nothing + , view = \i -> + [ b [ class "grayedout" ] [ text <| "s" ++ String.fromInt i.id ++ ": " ] + , text i.name ] + , key = \i -> String.fromInt i.aid + } + + charSource : SourceConfig m GApi.ApiCharResult charSource = { source = Endpoint (\s -> GC.send { search = s }) |