aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Model
diff options
context:
space:
mode:
authorJoris2016-03-30 14:17:59 +0200
committerJoris2016-03-30 14:17:59 +0200
commitc542551ad043260e6a4a6569b4af5c748f7b6001 (patch)
tree1b305d3d5c7280e34d19ef04365b47200e1bae9f /src/client/elm/Model
parentbaefda5a902a94cedf84cfcd2ae550267e5d932e (diff)
Filter own monthly payments in view
Diffstat (limited to 'src/client/elm/Model')
-rw-r--r--src/client/elm/Model/Payment.elm12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/elm/Model/Payment.elm b/src/client/elm/Model/Payment.elm
index e792c6c..27d5bed 100644
--- a/src/client/elm/Model/Payment.elm
+++ b/src/client/elm/Model/Payment.elm
@@ -8,8 +8,8 @@ module Model.Payment
, paymentIdDecoder
, deletePayment
, totalPayments
- , punctualPayments
- , monthlyPayments
+ , punctual
+ , monthly
) where
import Date exposing (..)
@@ -76,8 +76,8 @@ totalPayments paymentFilter userId payments =
|> List.map .cost
|> List.sum
-punctualPayments : Payments -> Payments
-punctualPayments = List.filter ((==) Punctual << .frequency)
+punctual : Payments -> Payments
+punctual = List.filter ((==) Punctual << .frequency)
-monthlyPayments : Payments -> Payments
-monthlyPayments = List.filter ((==) Monthly << .frequency)
+monthly : UserId -> Payments -> Payments
+monthly userId = List.filter (\p -> p.frequency == Monthly && p.userId == userId)