From e475a4e4711f00cdf51c1f3918a386d80f30f476 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Thu, 8 Sep 2022 11:26:54 -0500 Subject: [PATCH] Fix JSON schema for Xero Invoice --- src/Xero.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Xero.hs b/src/Xero.hs index 2fb8745..ae6d8e0 100644 --- a/src/Xero.hs +++ b/src/Xero.hs @@ -180,7 +180,7 @@ data XeroInvoice = , xi_number :: T.Text , xi_contact :: T.Text , xi_currency :: T.Text - , xi_currRate :: Double + , xi_currRate :: Maybe Double , xi_total :: Double , xi_status :: T.Text , xi_date :: T.Text @@ -199,7 +199,7 @@ instance FromJSON XeroInvoice where c <- obj .: "Contact" cN <- c .: "Name" cu <- obj .: "CurrencyCode" - cR <- obj .: "CurrencyRate" + cR <- obj .:? "CurrencyRate" total <- obj .: "AmountDue" status <- obj .: "Status" d <- obj .: "Date"