diff --git a/src/Components/Document/DocEditPage.js b/src/Components/Document/DocEditPage.js index 62c9c24..594afed 100644 --- a/src/Components/Document/DocEditPage.js +++ b/src/Components/Document/DocEditPage.js @@ -289,6 +289,7 @@ const DocEditPage = (props) => { async function postDocxData(obj) { const docId = documentId; + console.log("obj", obj); const response = await fetch(`${apiUrl}/v1/store-docx-data/${docId}`, { method: "POST", body: JSON.stringify(obj), @@ -338,8 +339,44 @@ const DocEditPage = (props) => { }; try { - const res = postDocxData(obj); - console.log("res to first post", res); + const response = await fetch(`${apiUrl}/v1/store-docx-data/${docId}`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + caseCaption1: captionOne, + caseCaption2: captionTwo, + caseNumber: caseNum, + clientPosition: clientPosition, + defendant: defendants, + firm: lawFirm, + firmCity: city, + firmState: usState.code, + firmStreetAddress: streetAdd, + firmZip: zipCode, + judge: judge, + jurisdiction: juris, + leadAttorneys: leadAttorneys, + plaintiff: plaintiffs, + state: state, + tel: telephone, + venue: venued, + }), + }); + if (response.status === 200) { + const response = await fetch( + `${apiUrl}/v1/generate-request-docx/${docId}`, + { + method: "POST", + headers: { + Accept: "application/json", + "Content-Type": "application/json", + }, + } + ); + return response; + } } catch (err) { console.log("err inpostDocxData", err); } @@ -453,8 +490,6 @@ const DocEditPage = (props) => { navigate(`/documents`); }; - console.log("parsedRogs", parsedRogs); - console.log("responses", responses); const editingContent = () => { return ( <> @@ -568,8 +603,7 @@ const DocEditPage = (props) => { }; const readyToEdit = fetchedCase && responses.length > 1; - console.log("readyToEdit", readyToEdit); - console.log("fetchedCase", fetchedCase); + return isLoading ? ( ) : isBusy ? (