mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
feat(web) Add drag n drop upload functionality (#1216)
* Add image drag n drop functionality * Change upload cover name, background color and opacity
This commit is contained in:
parent
6736063f83
commit
10b0924cfb
11 changed files with 159 additions and 177 deletions
21
web/src/lib/utils/asset-utils.ts
Normal file
21
web/src/lib/utils/asset-utils.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { api, AddAssetsResponseDto } from '@api';
|
||||
import {
|
||||
notificationController,
|
||||
NotificationType
|
||||
} from '$lib/components/shared-components/notification/notification';
|
||||
|
||||
export const addAssetsToAlbum = async (
|
||||
albumId: string,
|
||||
assetIds: Array<string>
|
||||
): Promise<AddAssetsResponseDto> =>
|
||||
api.albumApi.addAssetsToAlbum(albumId, { assetIds }).then(({ data: dto }) => {
|
||||
if (dto.successfullyAdded > 0) {
|
||||
// This might be 0 if the user tries to add an asset that is already in the album
|
||||
notificationController.show({
|
||||
message: `Added ${dto.successfullyAdded} to ${dto.album?.albumName}`,
|
||||
type: NotificationType.Info
|
||||
});
|
||||
}
|
||||
|
||||
return dto;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue