0
0
Fork 0
This commit is contained in:
Joan Sanchez 2023-03-10 13:04:48 +01:00
parent ad4e85b080
commit f546e36693
4 changed files with 21 additions and 9 deletions

View File

@ -28,10 +28,13 @@ async function confirm() {
if (props.promise) {
isLoading.value = true;
try {
Object.assign(response, props.data);
await props.send(response);
await props.promise(response);
} finally {
isLoading.value = false;
}
}
onDialogOK(response);
}

View File

@ -69,10 +69,14 @@ async function send() {
};
if (props.promise) {
isLoading.value = true;
try {
Object.assign(response, props.data);
await props.promise(response);
} finally {
isLoading.value = false;
}
}
onDialogOK(response);
}

View File

@ -41,9 +41,12 @@ const isLoading = ref(false);
async function confirm() {
isLoading.value = true;
if (props.promise) {
try {
await props.promise(props.data);
}
} finally {
isLoading.value = false;
}
}
onDialogOK(props.data);
}
</script>
@ -78,6 +81,8 @@ async function confirm() {
color="primary"
:loading="isLoading"
@click="confirm()"
unelevated
autofocus
/>
</q-card-actions>
</q-card>

View File

@ -43,7 +43,7 @@ function sendDeliveryNoteConfirmation(type = 'deliveryNote', documentType = 'pdf
type: type,
documentType: documentType,
},
send: sendDeliveryNote,
promise: sendDeliveryNote,
},
});
}