on master help sign in
Fixed Bacon Ipsum in every post
commit04bbef463173930e654616f1f26512995c4832ad authoriko <ilyakooo0@gmail.com> dateWed 23 Jan 2019, 18:42 (8 years ago) parentda5a84c
3 files changed+5−4
src/Foo/Data.hs+1−1 src/Lib.hs+1 src/Network/Bacon.hs+3−3
src/Foo/Data.hs+1−1
@@ -165,7 +165,7 @@ startAddingPosts lim cfg = do
165165 let us = users cfg
166166 let ps = posts cfg
167167
168− a <- liftIO $ loremBacon (manager cfg) (Just AllMeat) (Just lim) (Just False)
168+ a <- liftIO $ loremBacon (manager cfg) (Just AllMeat) (Just lim) (Just 0)
169169 g <- liftIO newStdGen
170170 let rns = randoms g
171171
src/Lib.hs+1
@@ -42,6 +42,7 @@ createServer = do
4242 atomically $ newUser cfg "Anna" "Androidovna"
4343 atomically $ newUser cfg "Darya" "Aiphonovna"
4444 atomically $ newUser cfg "Ilya" "Serverovich"
45+ atomically $ newUser cfg "Константин" "Дудосерович"
4546 return $ hoistServer server (createApp cfg) serverAPI
4647
4748server :: Proxy API
src/Network/Bacon.hs+3−3
@@ -21,15 +21,15 @@ instance ToHttpApiData LoremType where
2121 toQueryParam MeatAndFiller = "meat-and-filler"
2222 toQueryParam AllMeat = "all-meat"
2323
24−type API = QueryParam "type" LoremType :> QueryParam "paras" Int :> QueryParam "start-with-lorem" Bool :> Get '[JSON] [Text]
24+type API = QueryParam "type" LoremType :> QueryParam "paras" Int :> QueryParam "start-with-lorem" Int :> Get '[JSON] [Text]
2525
2626clientAPI :: Proxy API
2727clientAPI = Proxy
2828
29−loremBacon' :: Maybe LoremType -> Maybe Int -> Maybe Bool -> ClientM [Text]
29+loremBacon' :: Maybe LoremType -> Maybe Int -> Maybe Int -> ClientM [Text]
3030loremBacon' = client clientAPI
3131
32−loremBacon :: Manager -> Maybe LoremType -> Maybe Int -> Maybe Bool -> IO (Maybe [Text])
32+loremBacon :: Manager -> Maybe LoremType -> Maybe Int -> Maybe Int -> IO (Maybe [Text])
3333loremBacon mng a b c = do
3434 let env = mkClientEnv mng (BaseUrl Https "baconipsum.com" 443 "api")
3535 res <- runClientM (loremBacon' a b c) env