diff --git a/src/ZGoBackend.hs b/src/ZGoBackend.hs index e1e6749..399036e 100644 --- a/src/ZGoBackend.hs +++ b/src/ZGoBackend.hs @@ -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")