diff --git a/src/ZGoBackend.hs b/src/ZGoBackend.hs index 6cb8276..f74084e 100644 --- a/src/ZGoBackend.hs +++ b/src/ZGoBackend.hs @@ -918,7 +918,22 @@ routes pipe config = do Web.Scotty.json (object [ "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 id <- param "id" @@ -934,7 +949,22 @@ routes pipe config = do Web.Scotty.json (object [ "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 post "/api/owner" $ do