mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(web): use new open api client (#7097)
* refactor(web): use new open api client * refactor: remove activity api * refactor: trash, oauth, and partner apis * refactor: job api * refactor: face, library, system config * refactor: user api * refactor: album api
This commit is contained in:
parent
9b4a770b9d
commit
8fd94211c0
66 changed files with 593 additions and 850 deletions
|
|
@ -1,16 +1,17 @@
|
|||
<script lang="ts">
|
||||
import { type AlbumResponseDto, type UserResponseDto } from '@api';
|
||||
import { getMyUserInfo, removeUserFromAlbum } from '@immich/sdk';
|
||||
import { mdiDotsVertical } from '@mdi/js';
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
import { type AlbumResponseDto, api, type UserResponseDto } from '@api';
|
||||
import BaseModal from '../shared-components/base-modal.svelte';
|
||||
import UserAvatar from '../shared-components/user-avatar.svelte';
|
||||
import { getContextMenuPosition } from '../../utils/context-menu';
|
||||
import { handleError } from '../../utils/handle-error';
|
||||
import CircleIconButton from '../elements/buttons/circle-icon-button.svelte';
|
||||
import BaseModal from '../shared-components/base-modal.svelte';
|
||||
import ConfirmDialogue from '../shared-components/confirm-dialogue.svelte';
|
||||
import ContextMenu from '../shared-components/context-menu/context-menu.svelte';
|
||||
import MenuOption from '../shared-components/context-menu/menu-option.svelte';
|
||||
import { notificationController, NotificationType } from '../shared-components/notification/notification';
|
||||
import { handleError } from '../../utils/handle-error';
|
||||
import ConfirmDialogue from '../shared-components/confirm-dialogue.svelte';
|
||||
import { getContextMenuPosition } from '../../utils/context-menu';
|
||||
import { mdiDotsVertical } from '@mdi/js';
|
||||
import { NotificationType, notificationController } from '../shared-components/notification/notification';
|
||||
import UserAvatar from '../shared-components/user-avatar.svelte';
|
||||
|
||||
export let album: AlbumResponseDto;
|
||||
|
||||
|
|
@ -28,8 +29,7 @@
|
|||
|
||||
onMount(async () => {
|
||||
try {
|
||||
const { data } = await api.userApi.getMyUserInfo();
|
||||
currentUser = data;
|
||||
currentUser = await getMyUserInfo();
|
||||
} catch (error) {
|
||||
handleError(error, 'Unable to refresh user');
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
const userId = selectedRemoveUser.id === currentUser?.id ? 'me' : selectedRemoveUser.id;
|
||||
|
||||
try {
|
||||
await api.albumApi.removeUserFromAlbum({ id: album.id, userId });
|
||||
await removeUserFromAlbum({ id: album.id, userId });
|
||||
dispatch('remove', userId);
|
||||
const message = userId === 'me' ? `Left ${album.albumName}` : `Removed ${selectedRemoveUser.name}`;
|
||||
notificationController.show({ type: NotificationType.Info, message });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue