mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +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,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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue