Rebuild owner endpoints
This commit is contained in:
parent
a201810134
commit
d67d1937f5
1 changed files with 32 additions and 2 deletions
|
@ -918,7 +918,22 @@ routes pipe config = do
|
||||||
Web.Scotty.json
|
Web.Scotty.json
|
||||||
(object
|
(object
|
||||||
[ "message" .= ("Owner found!" :: String)
|
[ "message" .= ("Owner found!" :: String)
|
||||||
, "owner" .= toJSON (q :: Owner)
|
, "owner" .=
|
||||||
|
object
|
||||||
|
[ "_id" .= (show $ o_id q :: String)
|
||||||
|
, "address" .= oaddress q
|
||||||
|
, "name" .= oname q
|
||||||
|
, "currency" .= ocurrency q
|
||||||
|
, "tax" .= otax q
|
||||||
|
, "taxValue" .= otaxValue q
|
||||||
|
, "vat" .= ovat q
|
||||||
|
, "vatValue" .= ovatValue q
|
||||||
|
, "paid" .= opaid q
|
||||||
|
, "zats" .= ozats q
|
||||||
|
, "invoices" .= oinvoices q
|
||||||
|
, "expiration" .= oexpiration q
|
||||||
|
, "crmToken" .= ocrmToken q
|
||||||
|
]
|
||||||
])
|
])
|
||||||
get "/api/ownerid" $ do
|
get "/api/ownerid" $ do
|
||||||
id <- param "id"
|
id <- param "id"
|
||||||
|
@ -934,7 +949,22 @@ routes pipe config = do
|
||||||
Web.Scotty.json
|
Web.Scotty.json
|
||||||
(object
|
(object
|
||||||
[ "message" .= ("Owner found!" :: String)
|
[ "message" .= ("Owner found!" :: String)
|
||||||
, "owner" .= toJSON (q :: Owner)
|
, "owner" .=
|
||||||
|
object
|
||||||
|
[ "_id" .= (show $ o_id q :: String)
|
||||||
|
, "address" .= oaddress q
|
||||||
|
, "name" .= oname q
|
||||||
|
, "currency" .= ocurrency q
|
||||||
|
, "tax" .= otax q
|
||||||
|
, "taxValue" .= otaxValue q
|
||||||
|
, "vat" .= ovat q
|
||||||
|
, "vatValue" .= ovatValue q
|
||||||
|
, "paid" .= opaid q
|
||||||
|
, "zats" .= ozats q
|
||||||
|
, "invoices" .= oinvoices q
|
||||||
|
, "expiration" .= oexpiration q
|
||||||
|
, "crmToken" .= ocrmToken q
|
||||||
|
]
|
||||||
])
|
])
|
||||||
--Upsert owner to DB
|
--Upsert owner to DB
|
||||||
post "/api/owner" $ do
|
post "/api/owner" $ do
|
||||||
|
|
Loading…
Reference in a new issue