From c3a2ece1e259ff3d0251fefe16cc7a422ddca0ad Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Fri, 14 Mar 2025 11:52:09 +0100 Subject: Minucias minucias --- front/src/Main.elm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'front/src') diff --git a/front/src/Main.elm b/front/src/Main.elm index ad8862b..57a6f11 100644 --- a/front/src/Main.elm +++ b/front/src/Main.elm @@ -358,7 +358,7 @@ periodicUpdateDecoder = type alias SimUpdates = { periodically : List PeriodicUpdate - , byMonth : List ( Int, List SimUpdate ) + , byMonth : List ( Int, SimUpdate ) } @@ -380,11 +380,7 @@ simUpdatesEncode { periodically, byMonth } = [ ( "periodically", JE.list periodicUpdateEncode periodically ) , ( "by_month" , JE.object <| - List.map - (\( m, us ) -> - ( String.fromInt m, JE.list simUpdateEncode us ) - ) - byMonth + List.map (\( m, us ) -> ( String.fromInt m, simUpdateEncode us )) byMonth ) ] @@ -394,7 +390,7 @@ simUpdatesDecoder = JD.map2 SimUpdates (JD.field "periodically" (JD.list periodicUpdateDecoder)) (JD.field "by_month" - (JD.keyValuePairs (JD.list simUpdateDecoder) + (JD.keyValuePairs simUpdateDecoder |> JD.map (\l -> List.map (\( k, v ) -> ( Maybe.withDefault 0 (String.toInt k), v )) l @@ -1093,7 +1089,7 @@ quotaView m { updates } { month, payed, pending_principal } = , div [] (List.map (simUpdateView [ class "bg-lime-200" ] m << .upd) monthUpdates.periodically ++ (List.map (simUpdateView [ class "bg-lime-200" ] m) <| - List.concatMap Tuple.second monthUpdates.byMonth + List.map Tuple.second monthUpdates.byMonth ) ) ) -- cgit v1.2.3