Correct HTTP codes for invdata

This commit is contained in:
Rene Vergara 2023-06-22 08:26:55 -05:00
parent 87efbf0613
commit cd93f0031d
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -649,7 +649,7 @@ routes pipe config = do
let invReq = payload (invData :: Payload XeroInvoiceRequest) let invReq = payload (invData :: Payload XeroInvoiceRequest)
case cast' . Doc =<< xeroConfig of case cast' . Doc =<< xeroConfig of
Nothing -> do Nothing -> do
status noContent204 status ok200
Web.Scotty.json Web.Scotty.json
(object (object
[ "reportType" .= (1 :: Integer) [ "reportType" .= (1 :: Integer)
@ -660,7 +660,7 @@ routes pipe config = do
o <- liftAndCatchIO $ run $ findOwnerById $ xr_owner invReq o <- liftAndCatchIO $ run $ findOwnerById $ xr_owner invReq
case cast' . Doc =<< o of case cast' . Doc =<< o of
Nothing -> do Nothing -> do
status noContent204 status ok200
Web.Scotty.json Web.Scotty.json
(object (object
[ "reportType" .= (2 :: Integer) [ "reportType" .= (2 :: Integer)
@ -679,7 +679,7 @@ routes pipe config = do
oaddress o' oaddress o'
case resInv of case resInv of
Nothing -> do Nothing -> do
status noContent204 status ok200
Web.Scotty.json Web.Scotty.json
(object (object
[ "reportType" .= (2 :: Integer) [ "reportType" .= (2 :: Integer)
@ -701,7 +701,7 @@ routes pipe config = do
T.unpack . ocurrency $ o') T.unpack . ocurrency $ o')
case cast' . Doc =<< pr of case cast' . Doc =<< pr of
Nothing -> do Nothing -> do
status noContent204 status ok200
Web.Scotty.json Web.Scotty.json
(object (object
[ "reportType" .= [ "reportType" .=
@ -755,7 +755,7 @@ routes pipe config = do
text text
"Unable to save order to DB" "Unable to save order to DB"
Just fO -> do Just fO -> do
status ok200 status created201
Web.Scotty.json Web.Scotty.json
(object (object
[ "reportType" .= [ "reportType" .=
@ -766,7 +766,7 @@ routes pipe config = do
, "shop" .= oname o' , "shop" .= oname o'
]) ])
else do else do
status noContent204 status ok200
Web.Scotty.json Web.Scotty.json
(object (object
[ "reportType" .= [ "reportType" .=
@ -777,7 +777,7 @@ routes pipe config = do
(Nothing :: Maybe String) (Nothing :: Maybe String)
]) ])
else do else do
status noContent204 status ok200
Web.Scotty.json Web.Scotty.json
(object (object
[ "reportType" .= (7 :: Integer) [ "reportType" .= (7 :: Integer)
@ -786,7 +786,7 @@ routes pipe config = do
, "shop" .= (Nothing :: Maybe String) , "shop" .= (Nothing :: Maybe String)
]) ])
else do else do
status noContent204 status ok200
Web.Scotty.json Web.Scotty.json
(object (object
[ "reportType" .= (6 :: Integer) [ "reportType" .= (6 :: Integer)
@ -794,7 +794,7 @@ routes pipe config = do
, "shop" .= (Nothing :: Maybe String) , "shop" .= (Nothing :: Maybe String)
]) ])
else do else do
status noContent204 status ok200
Web.Scotty.json Web.Scotty.json
(object (object
[ "reportType" .= (5 :: Integer) [ "reportType" .= (5 :: Integer)
@ -802,7 +802,7 @@ routes pipe config = do
, "shop" .= (Nothing :: Maybe String) , "shop" .= (Nothing :: Maybe String)
]) ])
else do else do
status noContent204 status ok200
Web.Scotty.json Web.Scotty.json
(object (object
[ "reportType" .= (1 :: Integer) [ "reportType" .= (1 :: Integer)