Add getmainlang
endpoint
This commit is contained in:
parent
f68675af03
commit
1c202cf817
1 changed files with 10 additions and 1 deletions
|
@ -849,7 +849,8 @@ routes pipe config = do
|
|||
user <- liftAndCatchIO $ run (findUser sess)
|
||||
case user of
|
||||
Nothing -> status noContent204
|
||||
Just u -> status ok200
|
||||
Just u -> do
|
||||
status ok200
|
||||
--Get user associated with session
|
||||
get "/api/user" $ do
|
||||
sess <- param "session"
|
||||
|
@ -1140,6 +1141,14 @@ routes pipe config = do
|
|||
liftAndCatchIO $ run (deleteOrder oId)
|
||||
status ok200
|
||||
-- Get language for component
|
||||
get "/getmainlang" $ do
|
||||
lang <- param "lang"
|
||||
txtPack' <- liftAndCatchIO $ run (findLangComponent lang "main")
|
||||
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")
|
||||
|
|
Loading…
Reference in a new issue