Update WooCommerce endpoint

This commit is contained in:
Rene Vergara 2023-06-23 11:26:03 -05:00
parent ac0e74c818
commit 7672cdc083
Signed by: pitmutt
GPG Key ID: 65122AD495A7F5B2
1 changed files with 4 additions and 2 deletions

View File

@ -1001,6 +1001,7 @@ routes pipe config = do
Just o ->
if opaid o
then do
tk <- liftIO generateToken
let newOrder =
ZGoOrder
Nothing
@ -1027,10 +1028,11 @@ routes pipe config = do
(T.concat
[T.pack sUrl, "-", ordId, "-", orderKey])
""
""
(T.pack tk)
newId <- liftAndCatchIO $ run (insertWooOrder newOrder)
status ok200
Web.Scotty.json (object ["order" .= show newId])
Web.Scotty.json
(object ["order" .= show newId, "token" .= tk])
else do
status accepted202
Web.Scotty.json