-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
83 additions
and
47 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
resources/js/components/userprofile/AcountDeleteDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<template> | ||
<b-card | ||
class="shadow-sm mb-4" | ||
:header="$t('Account Removal')" | ||
body-class="pb-1" | ||
footer-class="text-right" | ||
> | ||
<p>{{ $t('If you no longer plan to use this service, you can remove your account and delete all associated data.') }}</p> | ||
<template #footer> | ||
<b-button | ||
type="button" | ||
variant="danger" | ||
:disabled="isBusy" | ||
@click="confirmDelete" | ||
> | ||
<font-awesome-icon icon="user-times"/> | ||
{{ $t('Delete account') }} | ||
</b-button> | ||
</template> | ||
</b-card> | ||
</template> | ||
|
||
<script> | ||
import userprofileApi from "@/api/userprofile" | ||
import { showSnackbar } from '@/utils' | ||
export default { | ||
data() { | ||
return { | ||
isBusy: false, | ||
} | ||
}, | ||
methods: { | ||
async confirmDelete() { | ||
if (confirm(this.$t('Do you really want to delete your account and lose access to all data?'))) { | ||
this.isBusy = true | ||
try { | ||
let data = await userprofileApi.delete() | ||
showSnackbar(data.message) | ||
this.$emit('delete') | ||
} catch (err) { | ||
alert(err) | ||
} | ||
this.isBusy = false | ||
} | ||
}, | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<template> | ||
<b-container> | ||
<b-alert variant="info" show> | ||
<font-awesome-icon icon="info-circle"/> | ||
{{ $t('Your account has been deleted.') }} | ||
</b-alert> | ||
|
||
<div class="text-center mt-4"> | ||
<a :href="route('login')">{{ $t('Return to login') }}</a> | ||
</div> | ||
</b-container> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
title() { | ||
return this.$t('Account Deletion') | ||
}, | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters