diff options
author | Guillermo Ramos | 2025-03-14 11:52:09 +0100 |
---|---|---|
committer | Guillermo Ramos | 2025-03-15 20:05:59 +0100 |
commit | c3a2ece1e259ff3d0251fefe16cc7a422ddca0ad (patch) | |
tree | e16fb9aed22a44b55cec170bbd322991a5fbec97 /front/src | |
parent | 1a552ee15578c028fe05cef08e3e590f10a6f07d (diff) | |
download | hiccup-c3a2ece1e259ff3d0251fefe16cc7a422ddca0ad.tar.gz |
Minucias minucias
Diffstat (limited to 'front/src')
-rw-r--r-- | front/src/Main.elm | 12 |
1 files changed, 4 insertions, 8 deletions
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 ) ) ) |