add collection id
This commit is contained in:
parent
17e41b10b8
commit
e5fc1258ee
2 changed files with 6 additions and 2 deletions
|
@ -58,7 +58,8 @@ data OrderedCollectionPage a
|
||||||
|
|
||||||
data Collection order a
|
data Collection order a
|
||||||
= Collection
|
= Collection
|
||||||
{ summary :: String
|
{ id :: Url
|
||||||
|
, summary :: String
|
||||||
, items :: [a]
|
, items :: [a]
|
||||||
, first :: Maybe Url
|
, first :: Maybe Url
|
||||||
, last :: Maybe Url
|
, last :: Maybe Url
|
||||||
|
@ -101,6 +102,7 @@ instance A.ToJSON a => A.ToJSON (Collection Ordered a) where
|
||||||
[ "@context" A..=
|
[ "@context" A..=
|
||||||
[ "https://www.w3.org/ns/activitystreams" :: String
|
[ "https://www.w3.org/ns/activitystreams" :: String
|
||||||
]
|
]
|
||||||
|
, "id" A..= collection.id
|
||||||
, "type" A..= ("OrderedCollection" :: String)
|
, "type" A..= ("OrderedCollection" :: String)
|
||||||
, "summary" A..= collection.summary
|
, "summary" A..= collection.summary
|
||||||
, "totalItems" A..= length collection.items
|
, "totalItems" A..= length collection.items
|
||||||
|
@ -115,6 +117,7 @@ instance A.ToJSON a => A.ToJSON (Collection Unordered a) where
|
||||||
[ "@context" A..=
|
[ "@context" A..=
|
||||||
[ "https://www.w3.org/ns/activitystreams" :: String
|
[ "https://www.w3.org/ns/activitystreams" :: String
|
||||||
]
|
]
|
||||||
|
, "id" A..= collection.id
|
||||||
, "type" A..= ("Collection" :: String)
|
, "type" A..= ("Collection" :: String)
|
||||||
, "summary" A..= collection.summary
|
, "summary" A..= collection.summary
|
||||||
, "totalItems" A..= length collection.items
|
, "totalItems" A..= length collection.items
|
||||||
|
|
|
@ -139,7 +139,8 @@ handleOutbox details items = do
|
||||||
content :: Outbox
|
content :: Outbox
|
||||||
content =
|
content =
|
||||||
Collection
|
Collection
|
||||||
{ summary = details.username <> "'s notes"
|
{ id = outboxUrl
|
||||||
|
, summary = details.username <> "'s notes"
|
||||||
, items = items
|
, items = items
|
||||||
, first = Just $ outboxUrl <> "?page=true"
|
, first = Just $ outboxUrl <> "?page=true"
|
||||||
, last = Just $ outboxUrl <> "?page=true"
|
, last = Just $ outboxUrl <> "?page=true"
|
||||||
|
|
Loading…
Add table
Reference in a new issue