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 where
accountnamesH = return $ journalAccountNames j accountnamesH = return $ journalAccountNames j
transactionsH = return $ jtxns j transactionsH = return $ jtxns j
pricesH = return $ jpricedirectives j pricesH = return $ map priceDirectiveToMarketPrice $ jpricedirectives j
commoditiesH = return $ (M.keys . jinferredcommodities) j commoditiesH = return $ (M.keys . jinferredcommodities) j
accountsH = return $ ledgerTopAccounts $ ledgerFromJournal Hledger.Query.Any j accountsH = return $ ledgerTopAccounts $ ledgerFromJournal Hledger.Query.Any j
accounttransactionsH (a::AccountName) = do accounttransactionsH (a::AccountName) = do

View File

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

View File

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