Mercurial > hg > Members > toma > bulletinboard
changeset 10:bb7ee8f9d8d7
fix
author | Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 11 Feb 2014 13:44:09 +0900 |
parents | 6a406b315240 |
children | 5671c12701d0 |
files | RouteSetting.hs |
diffstat | 1 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/RouteSetting.hs Fri Feb 07 04:53:51 2014 +0900 +++ b/RouteSetting.hs Tue Feb 11 13:44:09 2014 +0900 @@ -21,7 +21,8 @@ (["showBoardMessage"], showBoardMessage), (["createBoardMessage"], createBoardMessage), (["editMessage"], editMessage), - (["editMessageUsingGet"], editMessageUsingGet)] + (["editMessageUsingGet"], editMessageUsingGet), + (["editMessageUsingGet2"], editMessageUsingGet2)] showBoard :: Jungle -> Query -> [Param] -> IO Response showBoard jungle query params = do @@ -158,3 +159,16 @@ editMessageUsingGetBy jungle bname id author key msg = do updateRootNodeWith (editMessage' id author key msg) jungle bname + +-- 書き込み後読み込む +editMessageUsingGet2 :: Jungle -> Query -> [Param] -> IO Response +editMessageUsingGet2 jungle query params = do + editMessageUsingGetBy jungle st_bname id lb_author lb_key lb_msg + a <- getRootNode jungle st_bname + return $ responseLBS status200 [("Content-type", "text/html")] $ pack $ show (size a) + where + st_bname = unpack $ fromJust . fromJust $ lookup "bname" query + id = read $ unpack $ fromJust . fromJust $ lookup "uuid" query + lb_author = pack $ unpack $ fromJust . fromJust $ lookup "author" query + lb_key = pack $ unpack $ fromJust . fromJust $ lookup "key" query + lb_msg = pack $ unpack $ fromJust . fromJust $ lookup "msg" query