mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(server): use UUID dto in asset controller (#2641)
* refactor: assetId => id * chore: open api * chore: remove unused dto * fix(web): assetId => id * fix: web test
This commit is contained in:
parent
422ad20641
commit
a9fb1d435a
16 changed files with 184 additions and 196 deletions
|
|
@ -87,7 +87,7 @@ describe('AlbumCard component', () => {
|
|||
expect(apiMock.assetApi.getAssetThumbnail).toHaveBeenCalledTimes(1);
|
||||
expect(apiMock.assetApi.getAssetThumbnail).toHaveBeenCalledWith(
|
||||
{
|
||||
assetId: 'thumbnailIdOne',
|
||||
id: 'thumbnailIdOne',
|
||||
format: ThumbnailFormat.Jpeg
|
||||
},
|
||||
{ responseType: 'blob' }
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
const { data } = await api.assetApi.getAssetThumbnail(
|
||||
{
|
||||
assetId: thubmnailId,
|
||||
id: thubmnailId,
|
||||
format: ThumbnailFormat.Jpeg
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@
|
|||
$downloadAssets[imageFileName] = 0;
|
||||
|
||||
const { data, status } = await api.assetApi.downloadFile(
|
||||
{ assetId, key },
|
||||
{ id: assetId, key },
|
||||
{
|
||||
responseType: 'blob',
|
||||
onDownloadProgress: (progressEvent) => {
|
||||
|
|
@ -216,7 +216,7 @@
|
|||
|
||||
const toggleFavorite = async () => {
|
||||
const { data } = await api.assetApi.updateAsset({
|
||||
assetId: asset.id,
|
||||
id: asset.id,
|
||||
updateAssetDto: {
|
||||
isFavorite: !asset.isFavorite
|
||||
}
|
||||
|
|
@ -269,7 +269,7 @@
|
|||
const toggleArchive = async () => {
|
||||
try {
|
||||
const { data } = await api.assetApi.updateAsset({
|
||||
assetId: asset.id,
|
||||
id: asset.id,
|
||||
updateAssetDto: {
|
||||
isArchived: !asset.isArchived
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
$: {
|
||||
// Get latest description from server
|
||||
if (asset.id) {
|
||||
api.assetApi.getAssetById({ assetId: asset.id }).then((res) => {
|
||||
api.assetApi.getAssetById({ id: asset.id }).then((res) => {
|
||||
people = res.data?.people || [];
|
||||
textarea.value = res.data?.exifInfo?.description || '';
|
||||
});
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
dispatch('description-focus-out');
|
||||
try {
|
||||
await api.assetApi.updateAsset({
|
||||
assetId: asset.id,
|
||||
id: asset.id,
|
||||
updateAssetDto: {
|
||||
description: description
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
const loadAssetData = async () => {
|
||||
try {
|
||||
const { data } = await api.assetApi.serveFile(
|
||||
{ assetId: asset.id, isThumb: false, isWeb: true, key: publicSharedKey },
|
||||
{ id: asset.id, isThumb: false, isWeb: true, key: publicSharedKey },
|
||||
{
|
||||
responseType: 'blob'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
for (const asset of getAssets()) {
|
||||
if (asset.isArchived !== isArchived) {
|
||||
api.assetApi.updateAsset({ assetId: asset.id, updateAssetDto: { isArchived } });
|
||||
api.assetApi.updateAsset({ id: asset.id, updateAssetDto: { isArchived } });
|
||||
|
||||
onAssetArchive(asset, isArchived);
|
||||
cnt = cnt + 1;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
let cnt = 0;
|
||||
for (const asset of getAssets()) {
|
||||
if (asset.isFavorite !== isFavorite) {
|
||||
api.assetApi.updateAsset({ assetId: asset.id, updateAssetDto: { isFavorite } });
|
||||
api.assetApi.updateAsset({ id: asset.id, updateAssetDto: { isFavorite } });
|
||||
onAssetFavorite(asset, isFavorite);
|
||||
cnt = cnt + 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
assetId = link.assets[0].id;
|
||||
}
|
||||
|
||||
const { data } = await api.assetApi.getAssetById({ assetId });
|
||||
const { data } = await api.assetApi.getAssetById({ id: assetId });
|
||||
|
||||
return data;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue