mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore(web): generate API functions with a single argument (#2568)
This commit is contained in:
parent
a460940430
commit
6c6c5ef651
65 changed files with 1913 additions and 491 deletions
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
const { albumName }: { albumName: string } = event.detail;
|
||||
const assetIds = Array.from(getAssets()).map((asset) => asset.id);
|
||||
api.albumApi.createAlbum({ albumName, assetIds }).then((response) => {
|
||||
api.albumApi.createAlbum({ createAlbumDto: { albumName, assetIds } }).then((response) => {
|
||||
const { id, albumName } = response.data;
|
||||
|
||||
notificationController.show({
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
for (const asset of getAssets()) {
|
||||
if (asset.isArchived !== isArchived) {
|
||||
api.assetApi.updateAsset(asset.id, { isArchived });
|
||||
api.assetApi.updateAsset({ assetId: asset.id, updateAssetDto: { isArchived } });
|
||||
|
||||
onAssetArchive(asset, isArchived);
|
||||
cnt = cnt + 1;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@
|
|||
let count = 0;
|
||||
|
||||
const { data: deletedAssets } = await api.assetApi.deleteAsset({
|
||||
ids: Array.from(getAssets()).map((a) => a.id)
|
||||
deleteAssetDto: {
|
||||
ids: Array.from(getAssets()).map((a) => a.id)
|
||||
}
|
||||
});
|
||||
|
||||
for (const asset of deletedAssets) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
let cnt = 0;
|
||||
for (const asset of getAssets()) {
|
||||
if (asset.isFavorite !== isFavorite) {
|
||||
api.assetApi.updateAsset(asset.id, { isFavorite });
|
||||
api.assetApi.updateAsset({ assetId: asset.id, updateAssetDto: { isFavorite } });
|
||||
onAssetFavorite(asset, isFavorite);
|
||||
cnt = cnt + 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,11 @@
|
|||
const handleRemoveFromAlbum = async () => {
|
||||
if (window.confirm('Do you want to remove selected assets from the album?')) {
|
||||
try {
|
||||
const { data } = await api.albumApi.removeAssetFromAlbum(album.id, {
|
||||
assetIds: Array.from(getAssets()).map((a) => a.id)
|
||||
const { data } = await api.albumApi.removeAssetFromAlbum({
|
||||
id: album.id,
|
||||
removeAssetsDto: {
|
||||
assetIds: Array.from(getAssets()).map((a) => a.id)
|
||||
}
|
||||
});
|
||||
|
||||
album = data;
|
||||
|
|
|
|||
|
|
@ -14,12 +14,12 @@
|
|||
// TODO: Rename API method or change functionality. The assetIds passed
|
||||
// in are kept instead of removed.
|
||||
const assetsToKeep = allAssets.filter((a) => !getAssets().has(a));
|
||||
await api.assetApi.removeAssetsFromSharedLink(
|
||||
{
|
||||
await api.assetApi.removeAssetsFromSharedLink({
|
||||
removeAssetsDto: {
|
||||
assetIds: assetsToKeep.map((a) => a.id)
|
||||
},
|
||||
sharedLink?.key
|
||||
);
|
||||
key: sharedLink?.key
|
||||
});
|
||||
|
||||
sharedLink.assets = assetsToKeep;
|
||||
clearSelect();
|
||||
|
|
|
|||
|
|
@ -28,8 +28,10 @@
|
|||
|
||||
onMount(async () => {
|
||||
const { data: assetCountByTimebucket } = await api.assetApi.getAssetCountByTimeBucket({
|
||||
timeGroup: TimeGroupEnum.Month,
|
||||
userId: user?.id
|
||||
getAssetCountByTimeBucketDto: {
|
||||
timeGroup: TimeGroupEnum.Month,
|
||||
userId: user?.id
|
||||
}
|
||||
});
|
||||
bucketInfo = assetCountByTimebucket;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue