mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 01:11:20 +03:00
refactor(web) open api client (#7103)
* refactor: person api * refactor: shared link and others
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import { getKey } from '$lib/utils';
|
||||
import { type AssetResponseDto } from '@api';
|
||||
import { getAssetInfo } from '@immich/sdk';
|
||||
import { writable } from 'svelte/store';
|
||||
import { api, type AssetResponseDto } from '@api';
|
||||
|
||||
function createAssetViewingStore() {
|
||||
const viewingAssetStoreState = writable<AssetResponseDto>();
|
||||
const viewState = writable<boolean>(false);
|
||||
|
||||
const setAssetId = async (id: string) => {
|
||||
const { data } = await api.assetApi.getAssetInfo({ id, key: api.getKey() });
|
||||
const data = await getAssetInfo({ id, key: getKey() });
|
||||
viewingAssetStoreState.set(data);
|
||||
viewState.set(true);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user