more
This commit is contained in:
@@ -174,8 +174,32 @@ 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,
|
||||||
|
});
|
||||||
|
const res = response;
|
||||||
|
return res;
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error sending responses to the server:", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleCreateDocx() {
|
async function handleCreateDocx() {
|
||||||
// TODO: compare to see if any changes made before gen, save those
|
// TODO: compare to see if any changes made before gen, save those
|
||||||
|
|
||||||
|
const res = await postEditedResponses();
|
||||||
|
|
||||||
const docId = documentId;
|
const docId = documentId;
|
||||||
const leadAttorneys = fetchedCase?.leadAttorneys
|
const leadAttorneys = fetchedCase?.leadAttorneys
|
||||||
? fetchedCase?.leadAttorneys
|
? fetchedCase?.leadAttorneys
|
||||||
@@ -194,7 +218,9 @@ const RequestEditPage = () => {
|
|||||||
: null;
|
: null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${apiUrl}/genDocx/${docId}/${reqType}`, {
|
const response = await fetch(
|
||||||
|
`${apiUrl}/generate-request-docx/${docId}/${reqType}`,
|
||||||
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
Accept: "application/json",
|
Accept: "application/json",
|
||||||
@@ -219,7 +245,8 @@ const RequestEditPage = () => {
|
|||||||
tel: telephone,
|
tel: telephone,
|
||||||
venue: venued,
|
venue: venued,
|
||||||
}),
|
}),
|
||||||
});
|
}
|
||||||
|
);
|
||||||
return response;
|
return response;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error sending requests to the server:", error);
|
console.error("Error sending requests to the server:", error);
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ const UploadModal = (props) => {
|
|||||||
try {
|
try {
|
||||||
if (radioValue === "complaint") {
|
if (radioValue === "complaint") {
|
||||||
if (clientPositiion === "Plaintiff") {
|
if (clientPositiion === "Plaintiff") {
|
||||||
console.log("sending POST to: ", `${apiUrl}/v1/gen-disc-request-pl`);
|
|
||||||
const response = await fetch(`${apiUrl}/v1/gen-disc-request-pl`, {
|
const response = await fetch(`${apiUrl}/v1/gen-disc-request-pl`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: file,
|
body: file,
|
||||||
|
|||||||
Reference in New Issue
Block a user