Merge pull request #194 from appwrite/fix-4742-account-deletion

fix: account deletion
This commit is contained in:
Torsten Dittmann
2022-11-25 11:03:39 +01:00
committed by GitHub
+4 -2
View File
@@ -1,17 +1,19 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { trackEvent } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { user } from '$lib/stores/user';
export let showDelete = false;
const deleteAccount = async () => {
try {
await sdkForConsole.users.delete($user.$id);
await sdkForConsole.account.updateStatus();
showDelete = false;
invalidate(Dependencies.ACCOUNT);
addNotification({
type: 'success',
message: `Account was deleted `