From 04e0638752d4577d8f25278fb58f43ed29fab070 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Thu, 11 May 2023 14:26:24 -0500 Subject: [PATCH] Add `getscanlang` endpoint --- src/ZGoBackend.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ZGoBackend.hs b/src/ZGoBackend.hs index 3e13d45..56bbff3 100644 --- a/src/ZGoBackend.hs +++ b/src/ZGoBackend.hs @@ -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")