Merged PR 2351: fix csp by making it server side
Related work items: #23447
This commit is contained in:
@@ -199,27 +199,6 @@ let AdvancedSearch = (props) => {
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
|
||||
const [caseStatusValues, setCaseStatusValues] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchCaseStatus = async () => {
|
||||
try {
|
||||
const response = await getCaseStatus();
|
||||
|
||||
setCaseStatusValues(
|
||||
Array.isArray(response?.data)
|
||||
? response.data
|
||||
: response?.data?.value || response || []
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch case statuses", error);
|
||||
setCaseStatusValues([]);
|
||||
}
|
||||
};
|
||||
|
||||
fetchCaseStatus();
|
||||
}, []);
|
||||
|
||||
const {
|
||||
LPAData,
|
||||
onSubmit,
|
||||
@@ -246,6 +225,11 @@ let AdvancedSearch = (props) => {
|
||||
? props.LPAData.LPAData.value
|
||||
: [{}];
|
||||
|
||||
const caseStatusObject =
|
||||
props?.LPAData?.caseStatusObj?.length > 0
|
||||
? props.LPAData.caseStatusObj
|
||||
: [{}];
|
||||
|
||||
const RenderLPAList = ({
|
||||
name,
|
||||
id,
|
||||
@@ -705,7 +689,7 @@ let AdvancedSearch = (props) => {
|
||||
name="statusCode"
|
||||
id="statusCode"
|
||||
component={RenderCaseStatusList}
|
||||
optionsObj={caseStatusValues}
|
||||
optionsObj={caseStatusObject}
|
||||
//validate={[required]}
|
||||
label={t(
|
||||
"search:case-status-label"
|
||||
|
||||
Reference in New Issue
Block a user