From 72fa01c7d7202b4cf5371a10b2e671584ce43040 Mon Sep 17 00:00:00 2001 From: Axel Froborg Date: Thu, 11 Jan 2024 20:42:41 +0100 Subject: [PATCH] fix sizing and order --- web/src/components/layout/not-found.tsx | 2 +- web/src/lib/years.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/src/components/layout/not-found.tsx b/web/src/components/layout/not-found.tsx index 1ea4ff2..beaa47b 100644 --- a/web/src/components/layout/not-found.tsx +++ b/web/src/components/layout/not-found.tsx @@ -31,7 +31,7 @@ const YearNotFound: React.FC = ({ => { // fetches the year data from strapi const resp = await getAsync(`/years/${year}?password=${password}`, { @@ -37,7 +37,7 @@ const getCurrentYear = async ( }; const getPreviousYears = async ( - locale: string + locale: string, ): Promise => { const isSwe = locale === 'sv'; const title = isSwe ? 'Nollningsåret hittades inte' : 'Year not found'; @@ -49,14 +49,14 @@ const getPreviousYears = async ( title, description, found: false, - years: resp, + years: resp.toSorted((a, b) => Number(b.year) - Number(a.year)), }; }; export const getYearData = async ( year: string, password: string, - locale: string + locale: string, ): Promise => { const currentYear = await getCurrentYear(year, password, locale);