chore(web): generate API functions with a single argument (#2568)

This commit is contained in:
Sergey Kondrikov 2023-05-28 04:52:22 +03:00 committed by GitHub
parent a460940430
commit 6c6c5ef651
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 1913 additions and 491 deletions

View file

@ -16,7 +16,7 @@
export let shared: boolean;
onMount(async () => {
const { data } = await api.albumApi.getAllAlbums(shared || undefined);
const { data } = await api.albumApi.getAllAlbums({ shared: shared || undefined });
albums = data;
recentAlbums = albums

View file

@ -10,9 +10,12 @@
const dispatch = createEventDispatcher();
const getUserAvatar = async () => {
const { data } = await api.userApi.getProfileImage(user.id, {
responseType: 'blob'
});
const { data } = await api.userApi.getProfileImage(
{ userId: user.id },
{
responseType: 'blob'
}
);
if (data instanceof Blob) {
return URL.createObjectURL(data);

View file

@ -60,22 +60,26 @@
try {
if (shareType === SharedLinkType.Album && album) {
const { data } = await api.albumApi.createAlbumSharedLink({
albumId: album.id,
expiresAt: expirationDate,
allowUpload: isAllowUpload,
description: description,
allowDownload: isAllowDownload,
showExif: shouldShowExif
createAlbumShareLinkDto: {
albumId: album.id,
expiresAt: expirationDate,
allowUpload: isAllowUpload,
description: description,
allowDownload: isAllowDownload,
showExif: shouldShowExif
}
});
buildSharedLink(data);
} else {
const { data } = await api.assetApi.createAssetsSharedLink({
assetIds: sharedAssets.map((a) => a.id),
expiresAt: expirationDate,
allowUpload: isAllowUpload,
description: description,
allowDownload: isAllowDownload,
showExif: shouldShowExif
createAssetsShareLinkDto: {
assetIds: sharedAssets.map((a) => a.id),
expiresAt: expirationDate,
allowUpload: isAllowUpload,
description: description,
allowDownload: isAllowDownload,
showExif: shouldShowExif
}
});
buildSharedLink(data);
}
@ -133,12 +137,15 @@
? new Date(currentTime + expirationTime).toISOString()
: null;
await api.shareApi.editSharedLink(editingLink.id, {
description,
expiresAt: shouldChangeExpirationTime ? expirationDate : undefined,
allowUpload: isAllowUpload,
allowDownload: isAllowDownload,
showExif: shouldShowExif
await api.shareApi.editSharedLink({
id: editingLink.id,
editSharedLinkDto: {
description,
expiresAt: shouldChangeExpirationTime ? expirationDate : undefined,
allowUpload: isAllowUpload,
allowDownload: isAllowDownload,
showExif: shouldShowExif
}
});
notificationController.show({

View file

@ -30,7 +30,7 @@
const getFavoriteCount = async () => {
try {
const { data: assets } = await api.assetApi.getAllAssets(undefined, true, undefined);
const { data: assets } = await api.assetApi.getAllAssets({ isFavorite: true });
return {
favorites: assets.length