web, api: update for MarketPrice/PriceDirective change

This commit is contained in:
Simon Michael 2019-06-10 17:24:50 -07:00
parent ce0354ddbe
commit 6a62bd6437
3 changed files with 3 additions and 2 deletions

View File

@ -152,7 +152,7 @@ hledgerApiApp staticdir j = Servant.serve api server
where
accountnamesH = return $ journalAccountNames j
transactionsH = return $ jtxns j
pricesH = return $ jpricedirectives j
pricesH = return $ map priceDirectiveToMarketPrice $ jpricedirectives j
commoditiesH = return $ (M.keys . jinferredcommodities) j
accountsH = return $ ledgerTopAccounts $ ledgerFromJournal Hledger.Query.Any j
accounttransactionsH (a::AccountName) = do

View File

@ -16,6 +16,7 @@ module Hledger.Data.Prices (
,mixedAmountValueAtDate
,mixedAmountApplyValuation
,priceLookup
,priceDirectiveToMarketPrice
,tests_Prices
)
where

View File

@ -69,7 +69,7 @@ getPricesR = do
VD{caps, j} <- getViewData
when (CapView `notElem` caps) (permissionDenied "Missing the 'view' capability")
selectRep $ do
provideJson $ jpricedirectives j
provideJson $ map priceDirectiveToMarketPrice $ jpricedirectives j
getCommoditiesR :: Handler TypedContent
getCommoditiesR = do