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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
81 changed files with 638 additions and 656 deletions

View file

@ -1,13 +1,15 @@
<script lang="ts">
import ImageThumbnail from '$lib/components/assets/thumbnail/image-thumbnail.svelte';
import Button from '$lib/components/elements/buttons/button.svelte';
import Icon from '$lib/components/elements/icon.svelte';
import { getPeopleThumbnailUrl } from '$lib/utils';
import { handleError } from '$lib/utils/handle-error';
import { SearchSuggestionType, type PersonResponseDto } from '@api';
import { getAllPeople, getSearchSuggestions } from '@immich/sdk';
import { mdiArrowRight, mdiClose } from '@mdi/js';
import { onMount } from 'svelte';
import { fly } from 'svelte/transition';
import Combobox, { type ComboBoxOption } from '../combobox.svelte';
import { SearchSuggestionType, api, type PersonResponseDto } from '@api';
import ImageThumbnail from '$lib/components/assets/thumbnail/image-thumbnail.svelte';
import Icon from '$lib/components/elements/icon.svelte';
import { mdiArrowRight, mdiClose } from '@mdi/js';
import { handleError } from '$lib/utils/handle-error';
import { onMount } from 'svelte';
enum MediaType {
All = 'all',
@ -108,8 +110,8 @@
const getPeople = async () => {
try {
const { data } = await api.personApi.getAllPeople({ withHidden: false });
suggestions.people = data.people;
const { people } = await getAllPeople({ withHidden: false });
suggestions.people = people;
} catch (error) {
handleError(error, 'Failed to get people');
}
@ -143,8 +145,8 @@
}
try {
const { data } = await api.searchApi.getSearchSuggestions({
type: type,
const data = await getSearchSuggestions({
$type: type,
country: params.country,
state: params.state,
make: params.cameraMake,
@ -251,7 +253,7 @@
<ImageThumbnail
circle
shadow
url={api.getPeopleThumbnailUrl(person.id)}
url={getPeopleThumbnailUrl(person.id)}
altText={person.name}
widthStyle="100px"
/>