refactor(web): use new open api client (#7097)

* refactor(web): use new open api client

* refactor: remove activity api

* refactor: trash, oauth, and partner apis

* refactor: job api

* refactor: face, library, system config

* refactor: user api

* refactor: album api
This commit is contained in:
Jason Rasmussen
2024-02-13 17:07:37 -05:00
committed by GitHub
parent 9b4a770b9d
commit 8fd94211c0
66 changed files with 593 additions and 850 deletions
+7 -20
View File
@@ -3,38 +3,25 @@
import empty2Url from '$lib/assets/empty-2.svg';
import AlbumCard from '$lib/components/album-page/album-card.svelte';
import LinkButton from '$lib/components/elements/buttons/link-button.svelte';
import Icon from '$lib/components/elements/icon.svelte';
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte';
import {
notificationController,
NotificationType,
} from '$lib/components/shared-components/notification/notification';
import UserAvatar from '$lib/components/shared-components/user-avatar.svelte';
import { AppRoute } from '$lib/constants';
import { api } from '@api';
import { flip } from 'svelte/animate';
import type { PageData } from './$types';
import { createAlbum } from '@immich/sdk';
import { mdiLink, mdiPlusBoxOutline } from '@mdi/js';
import Icon from '$lib/components/elements/icon.svelte';
import { flip } from 'svelte/animate';
import { handleError } from '../../../lib/utils/handle-error';
import type { PageData } from './$types';
export let data: PageData;
const createSharedAlbum = async () => {
try {
const { data: newAlbum } = await api.albumApi.createAlbum({
createAlbumDto: {
albumName: '',
},
});
const newAlbum = await createAlbum({ createAlbumDto: { albumName: '' } });
goto(`${AppRoute.ALBUMS}/${newAlbum.id}`);
} catch (error) {
notificationController.show({
message: 'Error creating album, check console for more details',
type: NotificationType.Error,
});
console.log('Error [createAlbum]', error);
handleError(error, 'Unable to create album');
}
};
</script>