From 3bc6b81abb058032c62d362cc38348dddd172e49 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 8 Jan 2024 15:45:46 -0800 Subject: fix(routes): shortcuts pass queries --- src/routes/birthdays/+server.ts | 7 ++++--- src/routes/wrapped/+server.ts | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/routes') diff --git a/src/routes/birthdays/+server.ts b/src/routes/birthdays/+server.ts index 7f0fd833..e20d6c8a 100644 --- a/src/routes/birthdays/+server.ts +++ b/src/routes/birthdays/+server.ts @@ -1,11 +1,12 @@ import root from '$lib/Utility/root.js'; -export const GET = ({ url }) => - Response.redirect( +export const GET = ({ url }) => { + return Response.redirect( root( `/tools/birthdays${ - url.searchParams.values.length > 0 ? `&${url.searchParams.toString()}` : '' + url.searchParams.toString().length > 0 ? `?${url.searchParams.toString()}` : '' }` ), 307 ); +}; diff --git a/src/routes/wrapped/+server.ts b/src/routes/wrapped/+server.ts index cc070af0..e9c8c8d2 100644 --- a/src/routes/wrapped/+server.ts +++ b/src/routes/wrapped/+server.ts @@ -3,7 +3,9 @@ import root from '$lib/Utility/root.js'; export const GET = ({ url }) => Response.redirect( root( - `/tools/wrapped${url.searchParams.values.length > 0 ? `&${url.searchParams.toString()}` : ''}` + `/tools/wrapped${ + url.searchParams.toString().length > 0 ? `&${url.searchParams.toString()}` : '' + }` ), 307 ); -- cgit v1.2.3