Commit 182f3d3f authored by Joris's avatar Joris

Fix payment page

parent 9dbb4e6f
......@@ -29,7 +29,7 @@ init :: forall t m. MonadWidget t m => m (Dynamic t (Loadable Init))
init = do
users <- AjaxUtil.getNow "api/users"
payments <- AjaxUtil.getNow "api/payments"
incomes <- AjaxUtil.getNow "api/incomes"
incomes <- AjaxUtil.getNow "api/deprecated/incomes"
categories <- AjaxUtil.getNow "api/categories"
paymentCategories <- AjaxUtil.getNow "api/paymentCategories"
return $ do
......
module Controller.Income
( list
, deprecatedList
, create
, edit
, delete
......@@ -58,6 +59,12 @@ list page perPage =
return $ IncomePage (IncomeHeader since byUser) incomes count) >>= json
)
deprecatedList :: ActionM ()
deprecatedList =
Secure.loggedAction (\_ ->
(liftIO . Query.run $ IncomePersistence.listAll) >>= json
)
create :: CreateIncomeForm -> ActionM ()
create form =
Secure.loggedAction (\user ->
......
......@@ -59,6 +59,9 @@ main = do
perPage <- S.param "perPage"
Income.list page perPage
S.get "/api/deprecated/incomes" $ do
Income.deprecatedList
S.post "/api/income" $
S.jsonData >>= Income.create
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment