more
This commit is contained in:
@@ -240,14 +240,54 @@ const RequestEditPage = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleCreateDocx() {
|
async function handleCreateDocx(docType) {
|
||||||
const res = await postEditedResponses();
|
// TODO: compare to see if any changes made before gen, save those
|
||||||
function sleep(ms) {
|
const docId = documentId;
|
||||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
const leadAttorneys = fetchedCase?.leadAttorneys
|
||||||
}
|
? fetchedCase?.leadAttorneys
|
||||||
await sleep(2000);
|
: null;
|
||||||
|
const reqType = docType;
|
||||||
|
const captionOne = fetchedCase?.caption;
|
||||||
|
const captionTwo = fetchedCase?.captionTwo;
|
||||||
|
const caseNum = fetchedCase?.caseNumber;
|
||||||
|
const plaintiffs = fetchedCase?.plaintiffParties;
|
||||||
|
const defendants = fetchedCase?.defendantParties;
|
||||||
|
const venued = fetchedCase?.venue;
|
||||||
|
const juris = fetchedCase?.jurisdiction;
|
||||||
|
const judge = fetchedCase?.judge;
|
||||||
|
const clientPosition = fetchedCase?.clientPosition
|
||||||
|
? fetchedCase?.clientPosition
|
||||||
|
: null;
|
||||||
|
const currentRequestType = docType;
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
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,
|
||||||
|
currentRequestType: currentRequestType,
|
||||||
|
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 resp = await fetch(
|
||||||
`${apiUrl}/v1/generate-request-docx/${docId}`,
|
`${apiUrl}/v1/generate-request-docx/${docId}`,
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@@ -255,14 +295,13 @@ const RequestEditPage = () => {
|
|||||||
Accept: "application/json",
|
Accept: "application/json",
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
|
||||||
docId: docId,
|
|
||||||
}),
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
return response;
|
|
||||||
} catch (error) {
|
return resp;
|
||||||
console.error("Error sending requests to the server:", error);
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log("err in postDocxData", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -537,3 +576,32 @@ const RequestEditPage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default RequestEditPage;
|
export default RequestEditPage;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
async function handleCreateDocx() {
|
||||||
|
const res = await postEditedResponses();
|
||||||
|
function sleep(ms) {
|
||||||
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||||
|
}
|
||||||
|
await sleep(2000);
|
||||||
|
try {
|
||||||
|
const response = await fetch(
|
||||||
|
`${apiUrl}/v1/generate-request-docx/${docId}`,
|
||||||
|
{
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
Accept: "application/json",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
docId: docId,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return response;
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error sending requests to the server:", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|||||||
@@ -30,19 +30,13 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
margin-bottom: 25px;
|
margin-bottom: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.req-editing-sub-wrapper {
|
.req-editing-sub-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
min-width: 700px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.doc-editing-instructions-header {
|
.doc-editing-instructions-header {
|
||||||
@@ -69,7 +63,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.req-item-inner-div {
|
.req-item-inner-div {
|
||||||
min-width: 700px;
|
min-width: 720px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.doc-editing-button-container {
|
.doc-editing-button-container {
|
||||||
@@ -334,10 +328,7 @@
|
|||||||
|
|
||||||
.request-text-up {
|
.request-text-up {
|
||||||
color: #a2a2a2;
|
color: #a2a2a2;
|
||||||
margin-top: 6px;
|
margin-top: 5px;
|
||||||
margin-bottom: 12px;
|
|
||||||
line-height: 2;
|
|
||||||
padding: 0px 5px;
|
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
&.reqq {
|
&.reqq {
|
||||||
max-width: 24px;
|
max-width: 24px;
|
||||||
@@ -385,6 +376,7 @@
|
|||||||
text-align: justify;
|
text-align: justify;
|
||||||
}
|
}
|
||||||
.req-edit-comesnow-box {
|
.req-edit-comesnow-box {
|
||||||
|
min-width: 740px;
|
||||||
margin-bottom: 18px;
|
margin-bottom: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user