diff --git a/actions/index.js b/actions/index.js index 1315af63..cba68508 100644 --- a/actions/index.js +++ b/actions/index.js @@ -2,6 +2,7 @@ import axios from "axios"; import https from "https"; import CryptoJS from "crypto-js"; import HmacSHA256 from "crypto-js/hmac-sha256"; +import { getFormCollection } from "../components/utils"; let BASE_URL; const port = parseInt(process.env.PORT, 10) || 3000; @@ -570,6 +571,13 @@ export const getAppealID = ( updateFormCollection, primaryAttribute ) => { + console.log( + "is this the collection?:", + getFormCollection(updateFormCollection) + ); + + let formCollectionName = getFormCollection(updateFormCollection); + console.log(formCollectionName); return axios .get( "/api/endpoint/getappealid_api?updateFormCollection=" + @@ -580,8 +588,11 @@ export const getAppealID = ( caseReference ) .then((res) => { - console.log(res.data); - var appealID = res.data.value[0][primaryAttribute]; + const result = Object.entries(res.data.value[0]).filter( + ([key]) => !key.startsWith("_") + )[0][1]; + + var appealID = result; return appealID; }) .catch((error) => { diff --git a/components/case/documents.js b/components/case/documents.js index 9743eb15..86c1ed4c 100644 --- a/components/case/documents.js +++ b/components/case/documents.js @@ -79,7 +79,14 @@ const DocumentDetails = (props) => { id="showDocumentType" name="showDocumentType" > - + {documentTypes.map((item, key) => { return ( ); })} @@ -364,6 +379,7 @@ const DocumentDetails = (props) => { selectedDocumentType, fieldSortState, orderByState, + getDocumentTypes, getDocumentResults, ]); @@ -390,7 +406,12 @@ const DocumentDetails = (props) => { setShowSpinnerState(false); }); }, - [props.incidentid, selectedOption, selectedDocumentType] + [ + props.incidentid, + selectedOption, + selectedDocumentType, + setDocumentDetails, + ] ); const getDocumentDetails = async () => { diff --git a/components/newappeal/createCase.js b/components/newappeal/createCase.js index 87d5a3c5..4aaa17a0 100644 --- a/components/newappeal/createCase.js +++ b/components/newappeal/createCase.js @@ -11,6 +11,7 @@ import { } from "../../store/appealType/action"; import { getFormCollectionByID } from "../utils"; import FileUpload from "./fileupload"; +import Aboutyou from "./aboutyou"; let CreateCase = (props) => { // useEffect(() => { @@ -231,6 +232,7 @@ let CreateCase = (props) => { return (