|
|
|
|
@ -28,7 +28,7 @@ import { t } from 'svelte-i18n';
|
|
|
|
|
import { get } from 'svelte/store';
|
|
|
|
|
import { handleError } from './handle-error';
|
|
|
|
|
|
|
|
|
|
export const addAssetsToAlbum = async (albumId: string, assetIds: string[]) => {
|
|
|
|
|
export const addAssetsToAlbum = async (albumId: string, assetIds: string[], showNotification = true) => {
|
|
|
|
|
const result = await addAssets({
|
|
|
|
|
id: albumId,
|
|
|
|
|
bulkIdsDto: {
|
|
|
|
|
@ -38,6 +38,8 @@ export const addAssetsToAlbum = async (albumId: string, assetIds: string[]) => {
|
|
|
|
|
});
|
|
|
|
|
const count = result.filter(({ success }) => success).length;
|
|
|
|
|
const $t = get(t);
|
|
|
|
|
|
|
|
|
|
if (showNotification) {
|
|
|
|
|
notificationController.show({
|
|
|
|
|
type: NotificationType.Info,
|
|
|
|
|
timeout: 5000,
|
|
|
|
|
@ -52,6 +54,7 @@ export const addAssetsToAlbum = async (albumId: string, assetIds: string[]) => {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const addAssetsToNewAlbum = async (albumName: string, assetIds: string[]) => {
|
|
|
|
|
|