1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-24 04:46:50 +02:00

fix(web,server): use POST request to get download info (#3694)

* fix(web,server): use POST request to get download info

* chore: open api
This commit is contained in:
Jason Rasmussen
2023-08-15 11:49:32 -04:00
committed by GitHub
parent a75f368d5b
commit efc7fdb669
17 changed files with 426 additions and 259 deletions

View File

@ -1,6 +1,6 @@
import { notificationController, NotificationType } from '$lib/components/shared-components/notification/notification';
import { downloadManager } from '$lib/stores/download';
import { api, AssetApiGetDownloadInfoRequest, BulkIdResponseDto, AssetResponseDto, DownloadResponseDto } from '@api';
import { api, BulkIdResponseDto, AssetResponseDto, DownloadResponseDto, DownloadInfoDto } from '@api';
import { handleError } from './handle-error';
export const addAssetsToAlbum = async (
@ -32,15 +32,11 @@ const downloadBlob = (data: Blob, filename: string) => {
URL.revokeObjectURL(url);
};
export const downloadArchive = async (
fileName: string,
options: Omit<AssetApiGetDownloadInfoRequest, 'key'>,
key?: string,
) => {
export const downloadArchive = async (fileName: string, options: DownloadInfoDto, key?: string) => {
let downloadInfo: DownloadResponseDto | null = null;
try {
const { data } = await api.assetApi.getDownloadInfo({ ...options, key });
const { data } = await api.assetApi.getDownloadInfo({ downloadInfoDto: options, key });
downloadInfo = data;
} catch (error) {
handleError(error, 'Unable to download files');