22151 multiple files issue
This commit is contained in:
@@ -13,7 +13,7 @@ import {
|
||||
ReadOnlyfield,
|
||||
RichMultiLinefield,
|
||||
Textfield,
|
||||
YesNofield,
|
||||
YesNofield
|
||||
} from "../elements";
|
||||
|
||||
export default function BuildField(props) {
|
||||
@@ -42,19 +42,24 @@ export default function BuildField(props) {
|
||||
setDocumentsList,
|
||||
documentList,
|
||||
maxSubField,
|
||||
datafieldcontent,
|
||||
datafieldcontent
|
||||
} = props;
|
||||
|
||||
// Extract deeply nested props for convenience (avoid props.props.props all over)
|
||||
// Defensive checks in case nested props don't exist
|
||||
const appealType = props?.props?.props?.appealType || {};
|
||||
const form = props?.props?.props?.form || {};
|
||||
const formProps = props?.props?.props?.props?.form || {};
|
||||
const setFilesForAppeal = props?.props?.props?.setFilesForAppeal;
|
||||
const accountDetails = props?.props?.props?.props?.accountDetails || {};
|
||||
const sectionProps = props?.props?.props || {};
|
||||
const pageProps = sectionProps?.props || {};
|
||||
|
||||
const appealType = sectionProps.appealType || {};
|
||||
const form = sectionProps.form || {};
|
||||
const formProps = pageProps.form || sectionProps.form || {};
|
||||
const setFilesForAppeal = sectionProps.setFilesForAppeal;
|
||||
const accountDetails =
|
||||
sectionProps.accountDetails || pageProps.accountDetails || {};
|
||||
const ticketnumber = appealType.caseReference?.ticketnumber || "";
|
||||
const fileList = appealType.fileList || {};
|
||||
const containerID = accountDetails.containerID || "";
|
||||
const containerID =
|
||||
accountDetails.containerID || sectionProps.containerID || "";
|
||||
|
||||
// Mapping fieldType to components
|
||||
const fieldTypeMap = {
|
||||
@@ -230,7 +235,7 @@ export default function BuildField(props) {
|
||||
parentFieldShowOnValue={parentFieldShowOnValue}
|
||||
validation={validation}
|
||||
/>
|
||||
),
|
||||
)
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user