2024-02-29 19:35:37 +01:00
|
|
|
import { authenticate, requestServerInfo } from '$lib/utils/auth';
|
2024-06-29 18:29:56 +02:00
|
|
|
import { getFormatter } from '$lib/utils/i18n';
|
2024-05-26 18:15:52 -04:00
|
|
|
import { searchUsersAdmin } from '@immich/sdk';
|
2024-02-29 19:35:37 +01:00
|
|
|
import type { PageLoad } from './$types';
|
|
|
|
|
|
2025-05-15 14:45:23 -04:00
|
|
|
export const load = (async ({ url }) => {
|
|
|
|
|
await authenticate(url, { admin: true });
|
2024-02-29 19:35:37 +01:00
|
|
|
await requestServerInfo();
|
2024-05-26 18:15:52 -04:00
|
|
|
const allUsers = await searchUsersAdmin({ withDeleted: false });
|
2024-06-29 18:29:56 +02:00
|
|
|
const $t = await getFormatter();
|
2024-02-29 19:35:37 +01:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
allUsers,
|
|
|
|
|
meta: {
|
2024-06-12 12:54:40 +02:00
|
|
|
title: $t('admin.external_library_management'),
|
2024-02-29 19:35:37 +01:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}) satisfies PageLoad;
|