From bd4d611d0417862f50aed4c8a21b1949f3709217 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Wed, 21 Jun 2023 14:29:41 -0500 Subject: [PATCH] Enhance `invdata` endpoint for Xero invoices --- src/ZGoBackend.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ZGoBackend.hs b/src/ZGoBackend.hs index a91066e..9ef0d30 100644 --- a/src/ZGoBackend.hs +++ b/src/ZGoBackend.hs @@ -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