Skip to content

Commit 2498292

Browse files
Sorterer satser før visning i tabell
1 parent 7b6508e commit 2498292

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/v2/gui/src/prosess/ung-beregning/UngBeregning.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ interface Props {
1313
barn: Barn[];
1414
}
1515

16+
const sortSatser = (data: UngdomsytelseSatsPeriodeDto[]) =>
17+
data?.toSorted((a, b) => new Date(a.fom).getTime() - new Date(b.fom).getTime()).toReversed();
18+
1619
const UngBeregning = ({ api, behandling, barn }: Props) => {
1720
const {
1821
data: satser,
@@ -22,6 +25,7 @@ const UngBeregning = ({ api, behandling, barn }: Props) => {
2225
} = useQuery<UngdomsytelseSatsPeriodeDto[]>({
2326
queryKey: ['satser', behandling.uuid],
2427
queryFn: () => api.getSatser(behandling.uuid),
28+
select: sortSatser,
2529
});
2630

2731
if (satserIsLoading) {

0 commit comments

Comments
 (0)