upload fies to storage account for appeal

This commit is contained in:
2022-07-07 17:06:56 +01:00
parent b96f3bb916
commit f23ad2a300
28 changed files with 956 additions and 179 deletions
+28 -1
View File
@@ -11,9 +11,10 @@ import {
setCaseReference,
setCurrentSection,
setDocumentsList,
setFilesForAppeal,
} from "../../store/appealType/action";
import { getFormCollectionByID } from "../utils";
import { updateCase, patchCase } from "../../actions";
import { updateCase, patchCase, uploadFiles } from "../../actions";
import { FieldsTranslations } from "../elements";
import jsonpath from "jsonpath";
@@ -69,10 +70,33 @@ let BuildSection = (props) => {
const handleParam = (setValue) => (e) => setValue(e.target.value);
const uploadAppealFiles = (values) => {
// get filelists from values object
let fileListObj = _.filter(values, function (v, key) {
return _.includes(key, "pinswg_fileUpload");
});
console.log(fileListObj);
var dataObj = values;
for (let key in dataObj) {
_.includes(key, "pinswg_fileUpload") == true && delete dataObj[key];
}
uploadFiles(dataObj, fileListObj).then((data) => {
console.log("hello", data);
return data;
});
};
const updateCaseProgress = (values) => {
let incidentId = props.appealType.caseReference.incidentid;
let updateBody = values || {};
uploadAppealFiles(values);
let appTypeCollection = getFormCollectionByID(
props.appealType.appealTypeID
);
@@ -402,6 +426,9 @@ const mapDispatchToProps = (dispatch) => {
setDocumentsList: (documentList) => {
dispatch(setDocumentsList(documentList));
},
setFilesForAppeal: (blobList) => {
dispatch(setFilesForAppeal(blobList));
},
};
};