add missing fields to note json

This commit is contained in:
me 2024-12-17 10:46:59 +02:00
parent ef487958b6
commit 3034f194c7

View file

@ -47,13 +47,17 @@ data Collection order a
instance A.ToJSON Note where
toJSON note =
A.object
A.object $
[ "type" A..= ("Note" :: String)
, "id" A..= note.noteId
, "published" A..= note.notePublished
, "attributedTo" A..= note.noteActor
, "content" A..= note.noteContent
, "name" A..= note.noteName
, "replies" A..= note.noteReplies
]
<> [ "name" A..= name | Just name <- [note.noteName] ]
<> [ "url" A..= url | Just url <- [note.noteUrl] ]
instance A.ToJSON Object where
toJSON = \case