Rename fields of InvitationReference
This commit is contained in:
parent
5bc0254f7f
commit
dfe0b4de5e
@ -87,13 +87,13 @@ deriving instance Show (InvitationReference junction)
|
|||||||
|
|
||||||
instance ToJSON (InvitationReference junction) where
|
instance ToJSON (InvitationReference junction) where
|
||||||
toJSON (InvRef fId) = JSON.object
|
toJSON (InvRef fId) = JSON.object
|
||||||
[ "type" JSON..= show (typeRep (Proxy @junction))
|
[ "junction" JSON..= show (typeRep (Proxy @junction))
|
||||||
, "key" JSON..= fId
|
, "record" JSON..= fId
|
||||||
]
|
]
|
||||||
instance IsInvitableJunction junction => FromJSON (InvitationReference junction) where
|
instance IsInvitableJunction junction => FromJSON (InvitationReference junction) where
|
||||||
parseJSON = JSON.withObject "InvitationReference" $ \o -> do
|
parseJSON = JSON.withObject "InvitationReference" $ \o -> do
|
||||||
table <- o JSON..: "type"
|
table <- o JSON..: "junction"
|
||||||
key <- o JSON..: "key"
|
key <- o JSON..: "record"
|
||||||
|
|
||||||
unless (table == show (typeRep (Proxy @junction))) $
|
unless (table == show (typeRep (Proxy @junction))) $
|
||||||
fail "Unexpected table"
|
fail "Unexpected table"
|
||||||
|
|||||||
Reference in New Issue
Block a user