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:
Jason Rasmussen 2024-02-13 17:07:37 -05:00 committed by GitHub
parent 9b4a770b9d
commit 8fd94211c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 593 additions and 850 deletions

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { api, type AuthDeviceResponseDto } from '@api';
import { type AuthDeviceResponseDto } from '@api';
import { getAuthDevices, logoutAuthDevice, logoutAuthDevices } from '@immich/sdk';
import { handleError } from '../../utils/handle-error';
import Button from '../elements/buttons/button.svelte';
import ConfirmDialogue from '../shared-components/confirm-dialogue.svelte';
@ -10,7 +11,7 @@
let deleteDevice: AuthDeviceResponseDto | null = null;
let deleteAll = false;
const refresh = () => api.authenticationApi.getAuthDevices().then(({ data }) => (devices = data));
const refresh = () => getAuthDevices().then((_devices) => (devices = _devices));
$: currentDevice = devices.find((device) => device.current);
$: otherDevices = devices.filter((device) => !device.current);
@ -21,7 +22,7 @@
}
try {
await api.authenticationApi.logoutAuthDevice({ id: deleteDevice.id });
await logoutAuthDevice({ id: deleteDevice.id });
notificationController.show({ message: `Logged out device`, type: NotificationType.Info });
} catch (error) {
handleError(error, 'Unable to log out device');
@ -33,7 +34,7 @@
const handleDeleteAll = async () => {
try {
await api.authenticationApi.logoutAuthDevices();
await logoutAuthDevices();
notificationController.show({
message: `Logged out all devices`,
type: NotificationType.Info,