...
Expand |
---|
title | changes in src/network/api.constants.ts |
---|
|
Code Block |
---|
export const FETCH_STATES_LIST = '/api/CustomerPortal/addressManagement/getAddressNodeData?type=State';
export const FETCH_COUNTRIES_NODE_DATA = '/api/CustomerPortal/addressManagement/getAddressNodeData?type=Country';
export const FETCH_ADDRESS_FROM_ADDRESS_HIERARCHY = '/api/CustomerPortal/fetchGeneralAddressCode'; |
|
CRMDashboard changes:
General Function to be called whenever any option from rendered dropdown is selected, it make call to api api/CustomerPortal/fetchGeneralAddressCode
...
In case isAddressHierarchyPresent
is false then we will render only Simple Input text field.
If isAddressHierarchyPresent
is true:
...
It fetches data from AddressNode table on basis of address hierarchy setup, and returns data for current and higher nodes to populate.
...
It also handle the logic to either disbale the higher level nodes based on whether their value is fetched and allow_override_hierarchy is false.
...
Similar logic as of Customer-Portal is used for rendering like on basis of isAddressHierarchyPresent and allowOverrideHierarchy.
Expand |
---|
title | saveAddressUsingAddressHierarchy code snippet called on onChange |
---|
|
Code Block |
---|
const saveAddressUsingAddressHierarchy = async (nodeValue, nodeType) => {
if (!nodeType) return;
if (!nodeValue) {
handleAddressFields(nodeType, null, false);
return;
}
const fetchLocality = await fetchAddressUsingAddressHierarchy({ queryString: nodeValue, searchType: nodeType });
if (!fetchLocality.isSuccess) {
form.setFieldsValue({
cityName: '',
stateName: '',
countryName: '',
});
setDisableLocality(false, null);
} else {
handleAddressFields(nodeType, fetchLocality, false);
}
}; |
|
...