mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(web): drop axios (#7490)
* refactor: downloadApi * refactor: assetApi * chore: drop axios * chore: tidy up * chore: fix exports * fix: show notification when download starts
This commit is contained in:
parent
bb3d81bfc5
commit
09a7291527
37 changed files with 217 additions and 20671 deletions
|
|
@ -1,22 +1,13 @@
|
|||
<script lang="ts">
|
||||
import { api } from '$lib/api';
|
||||
import { getKey } from '$lib/utils';
|
||||
import { type AssetResponseDto } from '@immich/sdk';
|
||||
import { serveFile, type AssetResponseDto } from '@immich/sdk';
|
||||
import { fade } from 'svelte/transition';
|
||||
import LoadingSpinner from '../shared-components/loading-spinner.svelte';
|
||||
|
||||
export let asset: AssetResponseDto;
|
||||
|
||||
const loadAssetData = async () => {
|
||||
const { data } = await api.assetApi.serveFile(
|
||||
{ id: asset.id, isThumb: false, isWeb: false, key: getKey() },
|
||||
{ responseType: 'blob' },
|
||||
);
|
||||
if (data instanceof Blob) {
|
||||
return URL.createObjectURL(data);
|
||||
} else {
|
||||
throw new TypeError('Invalid data format');
|
||||
}
|
||||
const data = await serveFile({ id: asset.id, isWeb: false, isThumb: false });
|
||||
return URL.createObjectURL(data);
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue