diff --git a/EnvelopeGenerator.Web/wwwroot/js/api-service.js b/EnvelopeGenerator.Web/wwwroot/js/api-service.js index 3b345a9c..1f11b03a 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/api-service.js +++ b/EnvelopeGenerator.Web/wwwroot/js/api-service.js @@ -4,17 +4,9 @@ const env = { } const url = { - get reject() { - return `/api/annotation/reject`; - }, - - get rejectRedir() { - return `/envelope/${env.envKey}`; - }, - - get share() { - return `/api/readonly`; - } + reject: `/api/annotation/reject`, + rejectRedir: `/envelope/${env.envKey}`, + share: `/api/readonly` }; function submitForm(form) { diff --git a/EnvelopeGenerator.Web/wwwroot/js/api-service.min.js b/EnvelopeGenerator.Web/wwwroot/js/api-service.min.js index 8c6b962d..231385ec 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/api-service.min.js +++ b/EnvelopeGenerator.Web/wwwroot/js/api-service.min.js @@ -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 rejectEnvelope(n){return createPost(url.reject,n,Content.JSON)}function redirect(n){return window.location.href=n}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={get reject(){return`/api/annotation/reject`},get rejectRedir(){return`/envelope/${env.envKey}`},get share(){return`/api/readonly`}}; \ No newline at end of file +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 rejectEnvelope(n){return createPost(url.reject,n,Content.JSON)}function redirect(n){return window.location.href=n}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`}; \ No newline at end of file