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() { async function cleanUpDocx() {
const docId = documentId; const docId = documentId;
const reqType = docType; fetch(`${apiUrl}/cleanUpDocx/${docId}`, {
fetch(`${apiUrl}/cleanUpDocx/${docId}/${reqType}`, {
method: "GET", method: "GET",
}) })
.then((response) => { .then((response) => {
@@ -262,6 +261,10 @@ const DocEditPage = (props) => {
async function createAndReturnDocx() { async function createAndReturnDocx() {
setIsBusy(true); setIsBusy(true);
const response = await handleCreateDocx(); const response = await handleCreateDocx();
console.log(
"why is this a fucking array~~~~~~~~~~~~~~~~~~~~~~~~~~>",
responses
);
if (response?.status === 200) { if (response?.status === 200) {
setTimeout(getDocx, 5000); setTimeout(getDocx, 5000);
setTimeout(cleanUpDocx, 10000); setTimeout(cleanUpDocx, 10000);
@@ -274,7 +277,7 @@ const DocEditPage = (props) => {
async function getDocx() { async function getDocx() {
const docId = documentId; const docId = documentId;
const reqType = docType; const reqType = docType;
fetch(`${apiUrl}/getDocx/${docId}/${reqType}`, { fetch(`${apiUrl}/v1/get-docx/${docId}/${reqType}`, {
method: "GET", method: "GET",
}).then((response) => { }).then((response) => {
response.blob().then((blob) => { response.blob().then((blob) => {
@@ -356,29 +359,11 @@ const DocEditPage = (props) => {
}, },
} }
); );
return response;
} }
return response;
} catch (err) { } catch (err) {
console.log("err inpostDocxData", 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 = () => { const handleConfirmReport = () => {