Enhance invdata endpoint for Xero invoices

This commit is contained in:
Rene Vergara 2023-06-21 14:29:41 -05:00
parent f29c5ecb03
commit bd4d611d04
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -643,9 +643,10 @@ routes pipe config = do
if res
then status ok200
else status noContent204
get "/invdata" $ do
invReq <- jsonData
post "/invdata" $ do
invData <- jsonData
xeroConfig <- liftAndCatchIO $ run findXero
let invReq = payload (invData :: Payload XeroInvoiceRequest)
case cast' . Doc =<< xeroConfig of
Nothing -> do
status noContent204