mirror of
https://code.naskya.net/repos/ndqEd
synced 2025-03-20 15:14:54 +09:00
S2S: deckOfferTicketF (i.e. local deck receives ticket from remote author)
This commit is contained in:
parent
0d922b0e5a
commit
ef8e1c1108
4 changed files with 178 additions and 102 deletions
src/Web
|
@ -1418,19 +1418,21 @@ encodeAdd h (Add obj target)
|
|||
|
||||
data Apply u = Apply
|
||||
{ applyObject :: ObjURI u
|
||||
, applyTarget :: ObjURI u
|
||||
, applyTarget :: Either (ObjURI u) (Authority u, Branch u)
|
||||
}
|
||||
|
||||
parseApply :: UriMode u => Object -> Parser (Apply u)
|
||||
parseApply o =
|
||||
Apply
|
||||
<$> o .: "object"
|
||||
<*> o .: "target"
|
||||
<*> (second fromDoc <$> o .:+ "target")
|
||||
where
|
||||
fromDoc (Doc h v) = (h, v)
|
||||
|
||||
encodeApply :: UriMode u => Apply u -> Series
|
||||
encodeApply (Apply obj target)
|
||||
= "object" .= obj
|
||||
<> "target" .= target
|
||||
<> "target" .=+ second (uncurry Doc) target
|
||||
|
||||
data CreateObject u
|
||||
= CreateNote (Authority u) (Note u)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue