Add upsert of language component

This commit is contained in:
Rene Vergara 2023-02-02 15:43:54 -06:00
parent fb82923949
commit de3293f6ec
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -82,5 +82,10 @@ loadLangComponent :: LangComponent -> Action IO ()
loadLangComponent lc = do
let langComp = val lc
case langComp of
Doc x -> insert_ "langcomps" x
Doc x ->
upsert
(select
["language" =: lc_lang lc, "component" =: lc_component lc]
"langcomps")
x
_ -> error "Couldn't parse language JSON"