diff options
Diffstat (limited to 'src/server/Model/Payment.hs')
-rw-r--r-- | src/server/Model/Payment.hs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/server/Model/Payment.hs b/src/server/Model/Payment.hs index 469f0d3..25b1bb7 100644 --- a/src/server/Model/Payment.hs +++ b/src/server/Model/Payment.hs @@ -42,11 +42,12 @@ getUserMonthlyPayments userId = getMonthlyPayments :: Persist [Entity Payment] getMonthlyPayments = - selectList - [ PaymentDeletedAt P.==. Nothing - , PaymentFrequency P.==. Monthly - ] - [ Desc PaymentCreation ] + select $ + from $ \payment -> do + where_ (isNothing (payment ^. PaymentDeletedAt)) + where_ (payment ^. PaymentFrequency E.==. val Monthly) + orderBy [desc (lower_ (payment ^. PaymentName))] + return payment getJsonPayment :: Entity Payment -> P.Payment getJsonPayment paymentEntity = |