Die Datei „api-service.js“ für HTTP-Anfragen erstellt. HTTP-POST-Anforderung erstellt, um die generierten Umschläge zurückzuweisen.

This commit is contained in:
Developer 02
2024-06-05 13:04:47 +02:00
parent f16a8bcdb9
commit d077a66796
10 changed files with 120 additions and 18 deletions

View File

@@ -0,0 +1,37 @@
$('.btn_reject').click(_ =>
Swal.fire({
title: localized.rejection,
html: `<div class="text-start fs-6 p-0 m-0">${localized.rejectionReasonQ}</div>`,
icon: "question",
input: "text",
inputAttributes: {
autocapitalize: "off"
},
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: localized.complete,
cancelButtonText: localized.back,
showLoaderOnConfirm: true,
preConfirm: async (reason) => {
try {
var res = await rejectEnvelope(reason);
return res;
} catch (error) {
Swal.showValidationMessage(`
Request failed: ${error}
`);
}
},
allowOutsideClick: () => !Swal.isLoading()
}).then((result) => {
if (!result.isConfirmed)
return;
const res = result.value;
console.log(res)
if (res.ok) {
alert('rejected')
}
else
alert('fail')
}));