refactor: redirect code (#25054)

This commit is contained in:
Jason Rasmussen
2026-01-05 14:39:28 -05:00
committed by GitHub
parent 10989e6927
commit 4d32968f2b
13 changed files with 23 additions and 23 deletions
+1 -1
View File
@@ -3,5 +3,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export const load = (() => {
redirect(302, AppRoute.ADMIN_SETTINGS);
redirect(307, AppRoute.ADMIN_SETTINGS);
}) satisfies PageLoad;
@@ -13,7 +13,7 @@ export const load = (async ({ params: { id }, url }) => {
try {
library = await getLibrary({ id });
} catch {
redirect(302, AppRoute.ADMIN_LIBRARIES);
redirect(307, AppRoute.ADMIN_LIBRARIES);
}
const statistics = await getLibraryStatistics({ id });
+1 -1
View File
@@ -12,7 +12,7 @@ export const load = (async ({ params, url }) => {
const name = fromQueueSlug(params.name);
if (!name) {
redirect(302, AppRoute.ADMIN_QUEUES);
redirect(307, AppRoute.ADMIN_QUEUES);
}
const [queue, failedJobs] = await Promise.all([
+2 -2
View File
@@ -10,12 +10,12 @@ export const load = (async ({ params, url }) => {
await requestServerInfo();
if (!UUID_REGEX.test(params.id)) {
redirect(302, AppRoute.ADMIN_USERS);
redirect(307, AppRoute.ADMIN_USERS);
}
const [user] = await searchUsersAdmin({ id: params.id, withDeleted: true }).catch(() => []);
if (!user) {
redirect(302, AppRoute.ADMIN_USERS);
redirect(307, AppRoute.ADMIN_USERS);
}
const [userPreferences, userStatistics, userSessions] = await Promise.all([