param fixes

This commit is contained in:
Gabe Farrell 2025-12-31 18:38:20 -05:00
parent b0b0284a3d
commit f8eedeb6ef
3 changed files with 17 additions and 5 deletions

View file

@ -1,13 +1,14 @@
import Rewind from "~/components/rewind/Rewind";
import type { Route } from "./+types/Home";
import { getRewindStats, type RewindStats } from "api/api";
import { useEffect, useState } from "react";
import { type RewindStats } from "api/api";
import { useState } from "react";
import type { LoaderFunctionArgs } from "react-router";
import { useLoaderData } from "react-router";
import { getRewindYear } from "~/utils/utils";
export async function clientLoader({ request }: LoaderFunctionArgs) {
const url = new URL(request.url);
const year = url.searchParams.get("year") || new Date().getFullYear();
const year = url.searchParams.get("year") || getRewindYear();
const res = await fetch(`/apis/web/v1/summary?year=${year}`);
if (!res.ok) {