From c542551ad043260e6a4a6569b4af5c748f7b6001 Mon Sep 17 00:00:00 2001 From: Joris Date: Wed, 30 Mar 2016 14:17:59 +0200 Subject: Filter own monthly payments in view --- src/client/elm/Model/Payment.elm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/client/elm/Model') 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) -- cgit v1.2.3