refactor(web) open api client (#7103)

* refactor: person api

* refactor: shared link and others
This commit is contained in:
Jason Rasmussen
2024-02-14 08:09:49 -05:00
committed by GitHub
parent 5fc1d43012
commit d8631a00bb
81 changed files with 638 additions and 656 deletions

View File

@@ -3,6 +3,7 @@
import Icon from '$lib/components/elements/icon.svelte';
import { locale } from '$lib/stores/preferences.store';
import { user } from '$lib/stores/user.store';
import { getAssetThumbnailUrl } from '$lib/utils';
import { ThumbnailFormat, api, type AlbumResponseDto } from '@api';
import { getUserById } from '@immich/sdk';
import { mdiDotsVertical } from '@mdi/js';
@@ -19,7 +20,7 @@
let showVerticalDots = false;
$: imageData = album.albumThumbnailAssetId
? api.getAssetThumbnailUrl(album.albumThumbnailAssetId, ThumbnailFormat.Webp)
? getAssetThumbnailUrl(album.albumThumbnailAssetId, ThumbnailFormat.Webp)
: noThumbnailUrl;
const dispatchClick = createEventDispatcher<OnClick>();

View File

@@ -1,4 +1,4 @@
import type { AlbumResponseDto } from '@api';
import type { AlbumResponseDto } from '@immich/sdk';
export type OnShowContextMenu = {
showalbumcontextmenu: OnShowContextMenuDetail;

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { type AlbumResponseDto, type UserResponseDto } from '@api';
import { type AlbumResponseDto, type UserResponseDto } from '@immich/sdk';
import { getMyUserInfo, removeUserFromAlbum } from '@immich/sdk';
import { mdiDotsVertical } from '@mdi/js';
import { createEventDispatcher, onMount } from 'svelte';

View File

@@ -2,8 +2,13 @@
import { goto } from '$app/navigation';
import Icon from '$lib/components/elements/icon.svelte';
import { AppRoute } from '$lib/constants';
import { api, type AlbumResponseDto, type SharedLinkResponseDto, type UserResponseDto } from '@api';
import { getAllUsers } from '@immich/sdk';
import {
getAllSharedLinks,
getAllUsers,
type AlbumResponseDto,
type SharedLinkResponseDto,
type UserResponseDto,
} from '@immich/sdk';
import { mdiCheck, mdiLink, mdiShareCircle } from '@mdi/js';
import { createEventDispatcher, onMount } from 'svelte';
import Button from '../elements/buttons/button.svelte';
@@ -35,8 +40,7 @@
});
const getSharedLinks = async () => {
const { data } = await api.sharedLinkApi.getAllSharedLinks();
const data = await getAllSharedLinks();
sharedLinks = data.filter((link) => link.album?.id === album.id);
};