signature: add index on PDFSignatureZone + init POST signature

This commit is contained in:
nobohan
2024-07-11 08:06:18 +02:00
parent 39d3ba2f40
commit 77da2c1ac6
7 changed files with 66 additions and 20 deletions

View File

@@ -110,6 +110,7 @@
<script setup lang="ts">
import { ref, Ref, reactive } from "vue";
import { Signature, SignatureZone } from "../../types";
import { makeFetch } from "../../../../../ChillMainBundle/Resources/public/lib/api/apiMethods";
import * as pdfjsLib from "pdfjs-dist";
import {
PDFDocumentProxy,
@@ -321,11 +322,24 @@ const confirm_sign = () => {
console.log(userSignatureZones.value);
loading.value = true;
//TODO POST userSignatureZones to backend
setTimeout(() => {
loading.value = false;
modalOpen.value = false;
signed.value = true;
}, 3000); // FAKE
const url = `/api/1.0/document/workflow/${signature.id}/signature-request`;
const body = {
storedObject: signature.storedObject,
zone: userSignatureZones.value,
};
makeFetch('POST', url, body)
.then(r => {
})
.catch((error) => {
});
// setTimeout(() => {
// loading.value = false;
// modalOpen.value = false;
// signed.value = true;
// }, 3000); // FAKE
};
const undo_sign = async () => {