Add `getscanlang` endpoint

This commit is contained in:
Rene Vergara 2023-05-11 14:26:24 -05:00
parent f185c76fa0
commit 04e0638752
Signed by: pitmutt
GPG Key ID: 65122AD495A7F5B2
1 changed files with 8 additions and 0 deletions

View File

@ -1149,6 +1149,14 @@ routes pipe config = do
Just textPack -> do
status ok200
Web.Scotty.json $ toJSON (textPack :: LangComponent)
get "/getscanlang" $ do
lang <- param "lang"
txtPack' <- liftAndCatchIO $ run (findLangComponent lang "scan")
case cast' . Doc =<< txtPack' of
Nothing -> status noContent204
Just textPack -> do
status ok200
Web.Scotty.json $ toJSON (textPack :: LangComponent)
get "/getloginlang" $ do
lang <- param "lang"
txtPack' <- liftAndCatchIO $ run (findLangComponent lang "login")