This commit is contained in:
Kenneth Jannette
2024-03-12 09:04:39 -05:00
parent cb50bc5026
commit 61e8c75ecc

View File

@@ -247,8 +247,7 @@ const DocEditPage = (props) => {
async function cleanUpDocx() {
const docId = documentId;
const reqType = docType;
fetch(`${apiUrl}/cleanUpDocx/${docId}/${reqType}`, {
fetch(`${apiUrl}/cleanUpDocx/${docId}`, {
method: "GET",
})
.then((response) => {
@@ -262,6 +261,10 @@ const DocEditPage = (props) => {
async function createAndReturnDocx() {
setIsBusy(true);
const response = await handleCreateDocx();
console.log(
"why is this a fucking array~~~~~~~~~~~~~~~~~~~~~~~~~~>",
responses
);
if (response?.status === 200) {
setTimeout(getDocx, 5000);
setTimeout(cleanUpDocx, 10000);
@@ -274,7 +277,7 @@ const DocEditPage = (props) => {
async function getDocx() {
const docId = documentId;
const reqType = docType;
fetch(`${apiUrl}/getDocx/${docId}/${reqType}`, {
fetch(`${apiUrl}/v1/get-docx/${docId}/${reqType}`, {
method: "GET",
}).then((response) => {
response.blob().then((blob) => {
@@ -356,29 +359,11 @@ const DocEditPage = (props) => {
},
}
);
return response;
}
return response;
} catch (err) {
console.log("err inpostDocxData", err);
}
/*
try {
const response = await fetch(
`${apiUrl}/v1/generate-request-docx/${docId}`,
{
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
}
);
return response;
} catch (error) {
console.error("Error sending responses to the server:", error);
}
*/
}
const handleConfirmReport = () => {