This commit is contained in:
Kenneth Jannette
2024-03-05 23:19:43 -06:00
parent 15707da326
commit f53bdea108

View File

@@ -176,29 +176,6 @@ const RequestEditPage = () => {
async function postEditedResponses() {
const mergedRequests = [...requests, ...prodReq];
let obj = {};
obj["type"] = "interrogatories-out";
obj["id"] = docId;
obj["requests"] = mergedRequests;
const data = JSON.stringify(obj);
try {
const response = await fetch(`${apiUrl}/v1/store-edited-completions`, {
method: "POST",
headers: { "Content-Type": "application/json" },
json: true,
body: data,
});
return response;
} catch (error) {
console.error("Error sending responses to the server:", error);
}
}
async function handleCreateDocx() {
// TODO: compare to see if any changes made before gen, save those
const res = await postEditedResponses();
const docId = documentId;
const leadAttorneys = fetchedCase?.leadAttorneys
@@ -216,17 +193,7 @@ const RequestEditPage = () => {
const clientPosition = fetchedCase?.clientPosition
? fetchedCase?.clientPosition
: null;
try {
const response = await fetch(
`${apiUrl}/v1/generate-request-docx/${docId}/${reqType}`,
{
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
const caseInfo = {
caseCaption1: captionOne,
caseCaption2: captionTwo,
caseNumber: caseNum,
@@ -244,9 +211,44 @@ const RequestEditPage = () => {
state: state,
tel: telephone,
venue: venued,
}),
};
let obj = {};
obj["type"] = "interrogatories-out";
obj["id"] = docId;
obj["requests"] = mergedRequests;
obj["caseInfo"] = caseInfo;
const data = JSON.stringify(obj);
try {
const response = await fetch(`${apiUrl}/v1/store-edited-completions`, {
method: "POST",
headers: { "Content-Type": "application/json" },
json: true,
body: data,
});
return response;
} catch (error) {
console.error("Error sending responses to the server:", error);
}
);
}
async function handleCreateDocx() {
// TODO: compare to see if any changes made before gen, save those
const res = await postEditedResponses();
try {
const response = await fetch(`${apiUrl}/v1/generate-request-docx/`, {
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);