Skip to content

High performance self-hosted photo and video management solution.

fix: duplicate api call on new library page (#25036)

Jason Rasmussen4147f1d912b2
diff --git a/web/src/routes/admin/library-management/(list)/new/+page.svelte b/web/src/routes/admin/library-management/(list)/new/+page.svelte
index b236b83ce8..fdad5aa91e 100644
--- a/web/src/routes/admin/library-management/(list)/new/+page.svelte
+++ b/web/src/routes/admin/library-management/(list)/new/+page.svelte
@@ -4,20 +4,20 @@
import { AppRoute } from '$lib/constants';
import { handleCreateLibrary } from '$lib/services/library.service';
import { user } from '$lib/stores/user.store';
- import { searchUsersAdmin } from '@immich/sdk';
import { FormModal, Text } from '@immich/ui';
import { mdiFolderSync } from '@mdi/js';
- import { onMount } from 'svelte';
import { t } from 'svelte-i18n';
+ import { type PageData } from './$types';
- let ownerId: string = $state($user.id);
+ type Props = {
+ data: PageData;
+ };
- let userOptions: { value: string; text: string }[] = $state([]);
+ const { data }: Props = $props();
- onMount(async () => {
- const users = await searchUsersAdmin({});
- userOptions = users.map((user) => ({ value: user.id, text: user.name }));
- });
+ let ownerId: string = $state($user.id);
+ const users = $state(data.allUsers);
+ const userOptions = $derived(users.map((user) => ({ value: user.id, text: user.name })));
const onClose = async () => {
await goto(AppRoute.ADMIN_LIBRARIES);