diff --git a/src/components/common/SendEmailDialog.vue b/src/components/common/SendEmailDialog.vue index 0db0af056..e22b60329 100644 --- a/src/components/common/SendEmailDialog.vue +++ b/src/components/common/SendEmailDialog.vue @@ -3,12 +3,13 @@ import { ref } from 'vue'; import { useDialogPluginComponent } from 'quasar'; import { useI18n } from 'vue-i18n'; -const $props = defineProps({ - address: { - type: String, - default: '', +const props = defineProps({ + data: { + type: Object, + requied: true, + default: null, }, - send: { + promise: { type: Function, required: true, }, @@ -19,24 +20,27 @@ defineEmits(['confirm', ...useDialogPluginComponent.emits]); const { dialogRef, onDialogOK } = useDialogPluginComponent(); const { t } = useI18n(); -const address = ref($props.address); +const address = ref(props.data.address); const isLoading = ref(false); async function confirm() { - isLoading.value = true; - await $props.send(address.value); - isLoading.value = false; + const response = { address }; - onDialogOK(); + if (props.promise) { + isLoading.value = true; + Object.assign(response, props.data); + await props.send(response); + isLoading.value = false; + } + + onDialogOK(response); }