Update changelog

This commit is contained in:
Rene Vergara 2022-08-20 08:18:40 -05:00
parent fbc41f9333
commit acf2103f0c
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2
2 changed files with 4 additions and 23 deletions

View file

@ -8,9 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- API endpoint to request a Xero invoice
- API endpoint to generate ZGo order from external invoice
- Type `XeroInvResponse`
- Type `XeroInvoice`
- Type `XeroToken` - Type `XeroToken`
- API endpoint to save a `XeroToken`
- API endpoint to query a Xero access token
- Type `Xero` - Type `Xero`
- API endpoint to query Xero configuration - API endpoint to query Xero configuration
- Field `crmToken` for `Owner` - Field `crmToken` for `Owner`

View file

@ -544,27 +544,6 @@ routes pipe config = do
status ok200 status ok200
Web.Scotty.json (object ["invdata" .= toJSON xI]) Web.Scotty.json (object ["invdata" .= toJSON xI])
else status noContent204 else status noContent204
post "/api/xerotoken" $ do
o <- jsonData
let q = payload (o :: Payload XeroToken)
_ <- liftIO $ run (upsertToken q)
status created201
get "/api/xerotoken" $ do
a <- param "address"
t <- liftIO $ run (findToken a)
case t of
Nothing -> status noContent204
Just t1 -> do
let xToken = cast' (Doc t1)
case xToken of
Nothing -> status noContent204
Just xt -> do
status ok200
Web.Scotty.json
(object
[ "message" .= ("Token found" :: String)
, "token" .= toJSON (xt :: XeroToken)
])
--Get user associated with session --Get user associated with session
get "/api/user" $ do get "/api/user" $ do
sess <- param "session" sess <- param "session"