From dfe0b4de5ebb27741f340306d81c571f29808e27 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 23 Apr 2019 01:34:18 +0200 Subject: [PATCH] Rename fields of InvitationReference --- src/Handler/Utils/Invitations.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Handler/Utils/Invitations.hs b/src/Handler/Utils/Invitations.hs index 257881ea1..ab73a7152 100644 --- a/src/Handler/Utils/Invitations.hs +++ b/src/Handler/Utils/Invitations.hs @@ -87,13 +87,13 @@ deriving instance Show (InvitationReference junction) instance ToJSON (InvitationReference junction) where toJSON (InvRef fId) = JSON.object - [ "type" JSON..= show (typeRep (Proxy @junction)) - , "key" JSON..= fId + [ "junction" JSON..= show (typeRep (Proxy @junction)) + , "record" JSON..= fId ] instance IsInvitableJunction junction => FromJSON (InvitationReference junction) where parseJSON = JSON.withObject "InvitationReference" $ \o -> do - table <- o JSON..: "type" - key <- o JSON..: "key" + table <- o JSON..: "junction" + key <- o JSON..: "record" unless (table == show (typeRep (Proxy @junction))) $ fail "Unexpected table"