1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-23 04:38:12 +02:00

fix: update error handling to match new API (#7117)

This commit is contained in:
Ben McCann
2024-02-14 07:25:15 -08:00
committed by GitHub
parent 6adff50f0a
commit 2906950188
3 changed files with 4 additions and 7 deletions

View File

@ -3,11 +3,11 @@
notificationController,
NotificationType,
} from '$lib/components/shared-components/notification/notification';
import { type ApiError } from '$lib/utils';
import { changePassword } from '@immich/sdk';
import { fade } from 'svelte/transition';
import SettingInputField, { SettingInputFieldType } from '../admin-page/settings/setting-input-field.svelte';
import Button from '../elements/buttons/button.svelte';
import type { HttpError } from '@sveltejs/kit';
let password = '';
let newPassword = '';
@ -28,7 +28,7 @@
} catch (error) {
console.error('Error [user-profile] [changePassword]', error);
notificationController.show({
message: (error as ApiError)?.response?.data?.message || 'Unable to change password',
message: (error as HttpError)?.body?.message || 'Unable to change password',
type: NotificationType.Error,
});
}