mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor: redirect code (#25054)
This commit is contained in:
@@ -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 });
|
||||
|
||||
@@ -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([
|
||||
|
||||
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user