mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-28 23:44:51 +09:00
Serve trivial HTML (that just displays the JSON object) in getMessageR
This commit is contained in:
parent
bd99729656
commit
5479c99e1c
1 changed files with 59 additions and 50 deletions
|
@ -42,6 +42,7 @@ import Yesod.Form.Functions (runFormPost)
|
|||
import Yesod.Form.Types (FormResult (..))
|
||||
import Yesod.Persist.Core (runDB, get404, getBy404)
|
||||
|
||||
import Data.Aeson.Encode.Pretty.ToEncoding
|
||||
import Network.FedURI
|
||||
import Web.ActivityPub
|
||||
import Yesod.Auth.Unverified
|
||||
|
@ -107,7 +108,8 @@ getNodeL getdid lmid = do
|
|||
-}
|
||||
|
||||
getDiscussionMessage :: ShrIdent -> LocalMessageId -> Handler TypedContent
|
||||
getDiscussionMessage shr lmid = selectRep $ provideAP $ runDB $ do
|
||||
getDiscussionMessage shr lmid = do
|
||||
doc <- runDB $ do
|
||||
sid <- getKeyBy404 $ UniqueSharer shr
|
||||
pid <- getKeyBy404 $ UniquePersonIdent sid
|
||||
lm <- get404 lmid
|
||||
|
@ -158,6 +160,13 @@ getDiscussionMessage shr lmid = selectRep $ provideAP $ runDB $ do
|
|||
, notePublished = Just $ messageCreated m
|
||||
, noteContent = messageContent m
|
||||
}
|
||||
selectRep $ do
|
||||
provideAP $ pure doc
|
||||
provideRep $
|
||||
defaultLayout
|
||||
[whamlet|
|
||||
<div><pre>#{encodePrettyToLazyText doc}
|
||||
|]
|
||||
|
||||
getTopReply :: Route App -> Handler Html
|
||||
getTopReply replyP = do
|
||||
|
|
Loading…
Reference in a new issue