mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
parent
7c2f7d6c51
commit
f55b3add80
242 changed files with 12794 additions and 13426 deletions
|
|
@ -1,36 +1,35 @@
|
|||
<script lang="ts">
|
||||
import { api, UserResponseDto } from '@api';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import ConfirmDialogue from '$lib/components/shared-components/confirm-dialogue.svelte';
|
||||
import { handleError } from '../../utils/handle-error';
|
||||
import { api, UserResponseDto } from '@api';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import ConfirmDialogue from '$lib/components/shared-components/confirm-dialogue.svelte';
|
||||
import { handleError } from '../../utils/handle-error';
|
||||
|
||||
export let user: UserResponseDto;
|
||||
export let user: UserResponseDto;
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
const deleteUser = async () => {
|
||||
try {
|
||||
const deletedUser = await api.userApi.deleteUser({ userId: user.id });
|
||||
if (deletedUser.data.deletedAt != null) {
|
||||
dispatch('user-delete-success');
|
||||
} else {
|
||||
dispatch('user-delete-fail');
|
||||
}
|
||||
} catch (error) {
|
||||
handleError(error, 'Unable to delete user');
|
||||
dispatch('user-delete-fail');
|
||||
}
|
||||
};
|
||||
const deleteUser = async () => {
|
||||
try {
|
||||
const deletedUser = await api.userApi.deleteUser({ userId: user.id });
|
||||
if (deletedUser.data.deletedAt != null) {
|
||||
dispatch('user-delete-success');
|
||||
} else {
|
||||
dispatch('user-delete-fail');
|
||||
}
|
||||
} catch (error) {
|
||||
handleError(error, 'Unable to delete user');
|
||||
dispatch('user-delete-fail');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<ConfirmDialogue title="Delete User" confirmText="Delete" on:confirm={deleteUser} on:cancel>
|
||||
<svelte:fragment slot="prompt">
|
||||
<div class="flex flex-col gap-4">
|
||||
<p>
|
||||
<b>{user.firstName} {user.lastName}</b>'s account and assets will be permanently deleted
|
||||
after 7 days.
|
||||
</p>
|
||||
<p>Are you sure you want to continue?</p>
|
||||
</div>
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="prompt">
|
||||
<div class="flex flex-col gap-4">
|
||||
<p>
|
||||
<b>{user.firstName} {user.lastName}</b>'s account and assets will be permanently deleted after 7 days.
|
||||
</p>
|
||||
<p>Are you sure you want to continue?</p>
|
||||
</div>
|
||||
</svelte:fragment>
|
||||
</ConfirmDialogue>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue