create envelope region

This commit is contained in:
tekh 2025-09-19 11:52:37 +02:00
parent f8297808ec
commit f1f4c6eaef
2 changed files with 7 additions and 5 deletions

View File

@ -41,6 +41,7 @@ function redirect(url) {
} }
//#endregion //#endregion
//#region envelope
function signEnvelope(annotations) { function signEnvelope(annotations) {
return createPost(`/api/annotation`, annotations, contentType) return createPost(`/api/annotation`, annotations, contentType)
} }
@ -49,10 +50,11 @@ function rejectEnvelope(reason) {
return createPost(url.reject, reason, Content.JSON); return createPost(url.reject, reason, Content.JSON);
} }
function redirRejected() {
return redirect(url.rejectRedir);
}
function shareEnvelope(receiverMail, dateValid) { function shareEnvelope(receiverMail, dateValid) {
return createPost(url.share, { receiverMail: receiverMail, dateValid: dateValid }, Content.JSON); return createPost(url.share, { receiverMail: receiverMail, dateValid: dateValid }, Content.JSON);
}
//#endregion
function redirRejected() {
return redirect(url.rejectRedir);
} }

View File

@ -1 +1 @@
function submitForm(n){fetch(n.action,{method:n.method,body:new FormData(n),headers:{"X-Requested-With":"XMLHttpRequest"}})}function createRequest(n,t,i,r="application/json"){return fetch(t,{credentials:"include",method:n,headers:{"Content-Type":r,"X-XSRF-TOKEN":env.xsrfToken},body:JSON.stringify(i)})}function createPost(n,t,i="application/json"){return createRequest("POST",n,t,i)}function redirect(n){return window.location.href=n}function signEnvelope(n){return createPost(`/api/annotation`,n,contentType)}function rejectEnvelope(n){return createPost(url.reject,n,Content.JSON)}function redirRejected(){return redirect(url.rejectRedir)}function shareEnvelope(n,t){return createPost(url.share,{receiverMail:n,dateValid:t},Content.JSON)}const env={xsrfToken:document.getElementsByName("__RequestVerificationToken")[0].value,envKey:document.querySelector('meta[name="env-key"]').getAttribute("content")},url={reject:`/api/annotation/reject`,rejectRedir:`/envelope/${env.envKey}`,share:`/api/readonly`}; function submitForm(n){fetch(n.action,{method:n.method,body:new FormData(n),headers:{"X-Requested-With":"XMLHttpRequest"}})}function createRequest(n,t,i,r="application/json"){return fetch(t,{credentials:"include",method:n,headers:{"Content-Type":r,"X-XSRF-TOKEN":env.xsrfToken},body:JSON.stringify(i)})}function createPost(n,t,i="application/json"){return createRequest("POST",n,t,i)}function redirect(n){return window.location.href=n}function signEnvelope(n){return createPost(`/api/annotation`,n,contentType)}function rejectEnvelope(n){return createPost(url.reject,n,Content.JSON)}function shareEnvelope(n,t){return createPost(url.share,{receiverMail:n,dateValid:t},Content.JSON)}function redirRejected(){return redirect(url.rejectRedir)}const env={xsrfToken:document.getElementsByName("__RequestVerificationToken")[0].value,envKey:document.querySelector('meta[name="env-key"]').getAttribute("content")},url={reject:`/api/annotation/reject`,rejectRedir:`/envelope/${env.envKey}`,share:`/api/readonly`};