Implement getOutboxItemR, serving AS2 and basic HTML
This commit is contained in:
parent
6d304b9307
commit
f07b56c259
1 changed files with 14 additions and 1 deletions
|
@ -309,7 +309,20 @@ getOutboxR :: ShrIdent -> Handler TypedContent
|
|||
getOutboxR = error "Not implemented yet"
|
||||
|
||||
getOutboxItemR :: ShrIdent -> KeyHashid OutboxItem -> Handler TypedContent
|
||||
getOutboxItemR = error "Not implemented yet"
|
||||
getOutboxItemR shr obkhid = do
|
||||
obid <- decodeKeyHashid404 obkhid
|
||||
doc <- runDB $ do
|
||||
sid <- getKeyBy404 $ UniqueSharer shr
|
||||
pid <- getKeyBy404 $ UniquePersonIdent sid
|
||||
ob <- get404 obid
|
||||
unless (outboxItemPerson ob == pid) notFound
|
||||
return $ persistJSONValue $ outboxItemActivity ob
|
||||
selectRep $ do
|
||||
provideAP $ pure doc
|
||||
provideRep $ defaultLayout $
|
||||
[whamlet|
|
||||
<div><pre>#{AEP.encodePrettyToLazyText doc}
|
||||
|]
|
||||
|
||||
postOutboxR :: ShrIdent -> Handler Html
|
||||
postOutboxR shrAuthor = do
|
||||
|
|
Loading…
Reference in a new issue