Die Ansicht EnvelopeRejected (EnvelopeRejected.cshtml) wurde so entwickelt, dass sie nach Ablehnung eines Umschlags angezeigt wird. Logik hinzugefügt, um eine Umleitung zu aktivieren, nachdem ein Umschlag abgelehnt wurde.

This commit is contained in:
Developer 02
2024-06-06 10:02:56 +02:00
parent d077a66796
commit 3fd2f90f65
13 changed files with 174 additions and 9 deletions

View File

@@ -9,11 +9,19 @@ class API {
return `/api/envelope/reject`;
}
static get REJECT_REDIR_URL(){
return `/envelopekey/${API.ENV_KEY}/rejected`;
}
static __XSRF_TOKEN
static get XSRF_TOKEN() {
API.__XSRF_TOKEN ??= document.getElementsByName('__RequestVerificationToken')[0].value;
return API.__XSRF_TOKEN;
}
static get ENV_KEY(){
return ENV_KEY ?? document.querySelector('meta[name="env-key"]').getAttribute('content');
}
}
const submitForm = async form => await fetch(form.action, {
@@ -38,4 +46,8 @@ const createRequest = async (method, url, body, contentType) => {
const createPost = (url, body, contentType) => createRequest('POST', url, body, contentType);
const rejectEnvelope = (reason) => createPost(API.REJECT_URL, reason, Content.JSON);
const rejectEnvelope = (reason) => createPost(API.REJECT_URL, reason, Content.JSON);
const redirect = (url) => window.location.href = url;
const redirRejected = () => redirect(API.REJECT_REDIR_URL);