Commit 26544804 authored by Ibnu Daru Aji's avatar Ibnu Daru Aji

fixed a few things. non-consequentials, i guess.

parent 2bbc108f
......@@ -124,7 +124,6 @@ postArticleCreateCoach (Authenticated user) (RequestCreateArticle RequestCreateA
randgen <- liftIO newStdGen
let appendage = T.pack $ take 10 $ randomRs ('a', 'z') randgen
slug = titleDescToSlug reqcrtarticlTitle reqcrtarticlDescription appendage
liftIO $ print reqcrtarticlTagList
articles <-
runDb $ do
insertArticle
......@@ -144,6 +143,6 @@ postArticleCreateCoach (Authenticated user) (RequestCreateArticle RequestCreateA
1
0
case articles of
[] -> throwError err404 {errBody = "No such article."}
[] -> throwError err410 {errBody = "Should be created, but now is gone."}
x:_ -> return $ ResponseArticle $ resultQueryToResponseArticle x
postArticleCreateCoach _ _ = throwError err401
......@@ -8,12 +8,10 @@ import Lib.Prelude
import Database.Persist.Postgresql
import Servant
import Servant.Auth.Server
import System.Random
data Configuration = Configuration
{ configurationPool :: ConnectionPool
, configurationJWTSettings :: JWTSettings
, configurationRandomGen :: StdGen
}
newtype CoachT m a = CoachT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment