mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00:00
fix: duplicate api call on new library page (#25036)
This commit is contained in:
parent
e4311da1a4
commit
4147f1d912
1 changed files with 9 additions and 9 deletions
|
|
@ -4,20 +4,20 @@
|
||||||
import { AppRoute } from '$lib/constants';
|
import { AppRoute } from '$lib/constants';
|
||||||
import { handleCreateLibrary } from '$lib/services/library.service';
|
import { handleCreateLibrary } from '$lib/services/library.service';
|
||||||
import { user } from '$lib/stores/user.store';
|
import { user } from '$lib/stores/user.store';
|
||||||
import { searchUsersAdmin } from '@immich/sdk';
|
|
||||||
import { FormModal, Text } from '@immich/ui';
|
import { FormModal, Text } from '@immich/ui';
|
||||||
import { mdiFolderSync } from '@mdi/js';
|
import { mdiFolderSync } from '@mdi/js';
|
||||||
import { onMount } from 'svelte';
|
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
|
import { type PageData } from './$types';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
data: PageData;
|
||||||
|
};
|
||||||
|
|
||||||
|
const { data }: Props = $props();
|
||||||
|
|
||||||
let ownerId: string = $state($user.id);
|
let ownerId: string = $state($user.id);
|
||||||
|
const users = $state(data.allUsers);
|
||||||
let userOptions: { value: string; text: string }[] = $state([]);
|
const userOptions = $derived(users.map((user) => ({ value: user.id, text: user.name })));
|
||||||
|
|
||||||
onMount(async () => {
|
|
||||||
const users = await searchUsersAdmin({});
|
|
||||||
userOptions = users.map((user) => ({ value: user.id, text: user.name }));
|
|
||||||
});
|
|
||||||
|
|
||||||
const onClose = async () => {
|
const onClose = async () => {
|
||||||
await goto(AppRoute.ADMIN_LIBRARIES);
|
await goto(AppRoute.ADMIN_LIBRARIES);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue