mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-29 15:44:51 +09:00
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"
|
getOutboxR = error "Not implemented yet"
|
||||||
|
|
||||||
getOutboxItemR :: ShrIdent -> KeyHashid OutboxItem -> Handler TypedContent
|
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 :: ShrIdent -> Handler Html
|
||||||
postOutboxR shrAuthor = do
|
postOutboxR shrAuthor = do
|
||||||
|
|
Loading…
Reference in a new issue