mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor: user settings (#25166)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { eventManager } from '$lib/managers/event-manager.svelte';
|
||||
import { handleError } from '$lib/utils/handle-error';
|
||||
import { getFormatter } from '$lib/utils/i18n';
|
||||
import { resetPinCode, type PinCodeResetDto } from '@immich/sdk';
|
||||
import { changePassword, resetPinCode, type ChangePasswordDto, type PinCodeResetDto } from '@immich/sdk';
|
||||
import { toastManager } from '@immich/ui';
|
||||
|
||||
export const handleResetPinCode = async (dto: PinCodeResetDto) => {
|
||||
@@ -16,3 +16,15 @@ export const handleResetPinCode = async (dto: PinCodeResetDto) => {
|
||||
handleError(error, $t('errors.failed_to_reset_pin_code'));
|
||||
}
|
||||
};
|
||||
|
||||
export const handleChangePassword = async (dto: ChangePasswordDto) => {
|
||||
const $t = await getFormatter();
|
||||
|
||||
try {
|
||||
await changePassword({ changePasswordDto: dto });
|
||||
toastManager.success($t('updated_password'));
|
||||
return true;
|
||||
} catch (error) {
|
||||
handleError(error, $t('errors.unable_to_change_password'));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user