rich text field and pdf create for appeal
This commit is contained in:
@@ -474,6 +474,52 @@ export const uploadPDFRepFiles = async (
|
||||
);
|
||||
};
|
||||
|
||||
export const uploadPDFAppealFiles = async (
|
||||
formContent,
|
||||
containerName,
|
||||
foldername,
|
||||
repType
|
||||
) => {
|
||||
const containerToken = await createContainerSas(containerName);
|
||||
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||
const containerClient = new ContainerClient(sasUrl);
|
||||
|
||||
const files = formContent;
|
||||
|
||||
console.log(formContent, containerName, foldername);
|
||||
console.log(
|
||||
"rep pdf files...",
|
||||
files,
|
||||
Object.keys(files).length,
|
||||
foldername
|
||||
);
|
||||
|
||||
// console.log(`files[${prop}] = ${files[prop][0].size}`);
|
||||
console.log(foldername + "/files/" + formContent.split("tmp/")[1]);
|
||||
|
||||
const blobName = foldername + "/" + formContent.split("tmp/")[1];
|
||||
console.log(blobName);
|
||||
|
||||
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
|
||||
const uploadBlobResponse = await blockBlobClient.uploadFile(formContent);
|
||||
|
||||
const tags = {
|
||||
containerid: containerName,
|
||||
caseID: foldername.split("/")[0],
|
||||
documentType: repType,
|
||||
blobType: "RepresentationPDF",
|
||||
};
|
||||
|
||||
console.log("the tags:", tags);
|
||||
const withTags = await blockBlobClient.setTags(tags);
|
||||
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||
|
||||
console.log(
|
||||
`Uploaded block blob ${files} successfully`,
|
||||
uploadBlobResponse.requestId
|
||||
);
|
||||
};
|
||||
|
||||
export const uploadPDFCaseFiles = async (
|
||||
formContent,
|
||||
containerName,
|
||||
|
||||
+41
-10
@@ -742,8 +742,7 @@ export const getWatchedCases = (loggedInUserId) => {
|
||||
export const getWatchedCasesProxy = (loggedInUserId) => {
|
||||
return axios
|
||||
.get(
|
||||
BASE_URL +
|
||||
"/api/endpoint/getwatchedcasesproxy_api?loggedInUserId=" +
|
||||
"/api/endpoint/getwatchedcasesproxy_api?loggedInUserId=" +
|
||||
loggedInUserId
|
||||
)
|
||||
.then((res) => res.data)
|
||||
@@ -1373,7 +1372,7 @@ export const generateRepPDF = async (formValues, containerID, casefolderID) => {
|
||||
method: "post",
|
||||
url: queryUrl,
|
||||
data: formValues,
|
||||
headers: { "content-type": "multipart/form-data" },
|
||||
//headers: { "content-type": "multipart/form-data" },
|
||||
};
|
||||
|
||||
//console.log(config);
|
||||
@@ -1384,6 +1383,38 @@ export const generateRepPDF = async (formValues, containerID, casefolderID) => {
|
||||
console.log("this serror", error);
|
||||
}
|
||||
};
|
||||
|
||||
export const generateAppealPDF = async (
|
||||
formValues,
|
||||
containerID,
|
||||
casefolderID
|
||||
) => {
|
||||
//let files = filesObj;
|
||||
|
||||
//console.log("generateAppealPDF function: " + formValues);
|
||||
// var formData = new FormData();
|
||||
// formValues.append("appealData", JSON.stringify(formValues));
|
||||
// formValues.append("containerID", containerID);
|
||||
// formValues.append("casefolderID", casefolderID);
|
||||
|
||||
var queryUrl = "/api/file/generateappealpdf";
|
||||
|
||||
const config = {
|
||||
method: "post",
|
||||
url: queryUrl,
|
||||
data: formValues,
|
||||
//headers: { "content-type": "multipart/form-data" },
|
||||
};
|
||||
|
||||
//console.log(config);
|
||||
try {
|
||||
const res = await axios(config);
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
console.log("this serror", error);
|
||||
}
|
||||
};
|
||||
|
||||
export const getFilesFromBlob = (containerName, casefolderID) => {
|
||||
console.log(
|
||||
" get files from blob",
|
||||
@@ -1542,13 +1573,13 @@ export const sendEmail = async (
|
||||
"personalisation": personalisation,
|
||||
};
|
||||
|
||||
console.log(
|
||||
"hwewwew: ",
|
||||
templateId,
|
||||
emailAddress,
|
||||
personalisation,
|
||||
reference
|
||||
);
|
||||
// console.log(
|
||||
// "hwewwew: ",
|
||||
// templateId,
|
||||
// emailAddress,
|
||||
// personalisation,
|
||||
// reference
|
||||
// );
|
||||
var queryUrl = "/api/email/notify";
|
||||
|
||||
var config = {
|
||||
|
||||
Reference in New Issue
Block a user