From 0d7b441c5acd9333e8491a0f08f422ade8c4a773 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 5 Jan 2024 21:55:47 -0800 Subject: fix(routes): shortcut queries --- src/routes/birthdays/+server.ts | 4 ++-- src/routes/wrapped/+server.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/routes') diff --git a/src/routes/birthdays/+server.ts b/src/routes/birthdays/+server.ts index fe94f3e5..2b9219b5 100644 --- a/src/routes/birthdays/+server.ts +++ b/src/routes/birthdays/+server.ts @@ -1,7 +1,7 @@ export const GET = ({ url }) => Response.redirect( `https://due.moe/tools?tool=birthdays${ - url.search.length > 0 ? url.search.replace('?', '') : '' + url.searchParams.values.length > 0 ? `&${url.searchParams.toString()}` : '' }`, - 302 + 301 ); diff --git a/src/routes/wrapped/+server.ts b/src/routes/wrapped/+server.ts index 851a4d7e..2eee34f0 100644 --- a/src/routes/wrapped/+server.ts +++ b/src/routes/wrapped/+server.ts @@ -1,5 +1,7 @@ export const GET = ({ url }) => Response.redirect( - `https://due.moe/tools?tool=wrapped${url.search.length > 0 ? url.search.replace('?', '') : ''}`, - 302 + `https://due.moe/tools?tool=wrapped${ + url.searchParams.values.length > 0 ? `&${url.searchParams.toString()}` : '' + }`, + 301 ); -- cgit v1.2.3