@@ -87,7 +87,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
if (values.country == null) { | if (values.country == null) { | ||||
setErrorMsg(intl.formatMessage({ id: 'pleaseFillInCountry' })) | setErrorMsg(intl.formatMessage({ id: 'pleaseFillInCountry' })) | ||||
} else { | } else { | ||||
if (values.country.key == 1 && values.district == null) { | |||||
if (values.country.type == "hongKong" && values.district == null) { | |||||
setErrorMsg(intl.formatMessage({ id: 'pleaseFillInDistrict' })) | setErrorMsg(intl.formatMessage({ id: 'pleaseFillInDistrict' })) | ||||
} else { | } else { | ||||
HttpUtils.post({ | HttpUtils.post({ | ||||
@@ -111,7 +111,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
faxNumber: values.faxNumber | faxNumber: values.faxNumber | ||||
}, | }, | ||||
addressTemp: { | addressTemp: { | ||||
country: values.country.id, | |||||
country: values.country.type, | |||||
district: values.district?.type, | district: values.district?.type, | ||||
addressLine1: values.addressLine1, | addressLine1: values.addressLine1, | ||||
addressLine2: values.addressLine2, | addressLine2: values.addressLine2, | ||||
@@ -65,7 +65,7 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
if (values.country==null){ | if (values.country==null){ | ||||
setErrorMsg(intl.formatMessage({id: 'pleaseFillInCountry'})) | setErrorMsg(intl.formatMessage({id: 'pleaseFillInCountry'})) | ||||
} else { | } else { | ||||
if (values.country.key ==1 && values.district == null){ | |||||
if (values.country.type =="hongKong" && values.district == null){ | |||||
setErrorMsg(intl.formatMessage({id: 'pleaseFillInDistrict'})) | setErrorMsg(intl.formatMessage({id: 'pleaseFillInDistrict'})) | ||||
} else { | } else { | ||||
HttpUtils.post({ | HttpUtils.post({ | ||||
@@ -81,8 +81,8 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
faxNumber: values.faxNumber | faxNumber: values.faxNumber | ||||
}, | }, | ||||
addressTemp: { | addressTemp: { | ||||
country: values.country.id, | |||||
district: values.district?.id, | |||||
country: values.country.type, | |||||
district: values.district?.type, | |||||
addressLine1: values.addressLine1, | addressLine1: values.addressLine1, | ||||
addressLine2: values.addressLine2, | addressLine2: values.addressLine2, | ||||
addressLine3: values.addressLine3, | addressLine3: values.addressLine3, | ||||
@@ -14,7 +14,7 @@ const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/Loa | |||||
import ForwardIcon from '@mui/icons-material/Forward'; | import ForwardIcon from '@mui/icons-material/Forward'; | ||||
import { useNavigate, useParams } from 'react-router-dom'; | import { useNavigate, useParams } from 'react-router-dom'; | ||||
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
import {getObjectByType, getObjectByValue} from "utils/CommonFunction"; | |||||
import {getObjectByType} from "utils/CommonFunction"; | |||||
import * as ComboData from "utils/ComboData"; | import * as ComboData from "utils/ComboData"; | ||||
import { | import { | ||||
isGLDLoggedIn, | isGLDLoggedIn, | ||||
@@ -72,7 +72,7 @@ const OrganizationDetailPage = () => { | |||||
url: UrlUtils.GET_ORG_PATH + "/" + params.id, | url: UrlUtils.GET_ORG_PATH + "/" + params.id, | ||||
onSuccess: function (response) { | onSuccess: function (response) { | ||||
// console.log(response) | // console.log(response) | ||||
response.data["country"] = getObjectByValue(ComboData.country, "key", response.data.addressTemp?.country); | |||||
response.data["country"] = getObjectByType(ComboData.country, "type", response.data.addressTemp?.country); | |||||
response.data["district"] = getObjectByType(ComboData.district, "type", response.data.addressTemp?.district); | response.data["district"] = getObjectByType(ComboData.district, "type", response.data.addressTemp?.district); | ||||
response.data["addressLine1"] = response.data.addressTemp?.addressLine1; | response.data["addressLine1"] = response.data.addressTemp?.addressLine1; | ||||
response.data["addressLine2"] = response.data.addressTemp?.addressLine2; | response.data["addressLine2"] = response.data.addressTemp?.addressLine2; | ||||
@@ -97,7 +97,7 @@ const OrganizationDetailPage = () => { | |||||
onSuccess: function (response) { | onSuccess: function (response) { | ||||
// console.log(response) | // console.log(response) | ||||
response.data["creditor"] = response.data.creditor!=null?response.data.creditor?isCreditor:notCreditor:notCreditor; | response.data["creditor"] = response.data.creditor!=null?response.data.creditor?isCreditor:notCreditor:notCreditor; | ||||
response.data["country"] = getObjectByValue(ComboData.country, "key", response.data.addressTemp?.country); | |||||
response.data["country"] = getObjectByType(ComboData.country, "type", response.data.addressTemp?.country); | |||||
response.data["district"] = getObjectByType(ComboData.district, "type", response.data.addressTemp?.district); | response.data["district"] = getObjectByType(ComboData.district, "type", response.data.addressTemp?.district); | ||||
response.data["addressLine1"] = response.data.addressTemp?.addressLine1; | response.data["addressLine1"] = response.data.addressTemp?.addressLine1; | ||||
response.data["addressLine2"] = response.data.addressTemp?.addressLine2; | response.data["addressLine2"] = response.data.addressTemp?.addressLine2; | ||||
@@ -75,7 +75,7 @@ const OrganizationCard_loadFromUser = ({ userData, userId }) => { | |||||
if (values.country == null) { | if (values.country == null) { | ||||
setErrorMsg(intl.formatMessage({ id: 'pleaseFillInCountry' })) | setErrorMsg(intl.formatMessage({ id: 'pleaseFillInCountry' })) | ||||
} else { | } else { | ||||
if (values.country.key == 1 && values.district == null) { | |||||
if (values.country.type == "hongKong" && values.district == null) { | |||||
setErrorMsg(intl.formatMessage({ id: 'pleaseFillInDistrict' })) | setErrorMsg(intl.formatMessage({ id: 'pleaseFillInDistrict' })) | ||||
} else { | } else { | ||||
HttpUtils.post({ | HttpUtils.post({ | ||||
@@ -100,8 +100,8 @@ const OrganizationCard_loadFromUser = ({ userData, userId }) => { | |||||
faxNumber: values.faxNumber | faxNumber: values.faxNumber | ||||
}, | }, | ||||
addressTemp: { | addressTemp: { | ||||
country: values.country.key, | |||||
district: values.district?.key, | |||||
country: values.country.type, | |||||
district: values.district?.type, | |||||
addressLine1: values.addressLine1, | addressLine1: values.addressLine1, | ||||
addressLine2: values.addressLine2, | addressLine2: values.addressLine2, | ||||
addressLine3: values.addressLine3, | addressLine3: values.addressLine3, | ||||
@@ -7,7 +7,7 @@ import {useParams} from "react-router-dom"; | |||||
import {useNavigate} from "react-router-dom"; | import {useNavigate} from "react-router-dom"; | ||||
import * as UrlUtils from "utils/ApiPathConst"; | import * as UrlUtils from "utils/ApiPathConst"; | ||||
import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
import {getObjectByValue} from "utils/CommonFunction"; | |||||
import {getObjectByType} from "utils/CommonFunction"; | |||||
import * as ComboData from "utils/ComboData"; | import * as ComboData from "utils/ComboData"; | ||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
@@ -46,8 +46,8 @@ const OrganizationDetailPage_FromUser = () => { | |||||
HttpUtils.get({ | HttpUtils.get({ | ||||
url: UrlUtils.GET_ORG_FROM_USER_PATH+"/"+params.id, | url: UrlUtils.GET_ORG_FROM_USER_PATH+"/"+params.id, | ||||
onSuccess: function(response){ | onSuccess: function(response){ | ||||
response.data["country"] = getObjectByValue(ComboData.country, "key", response.data.addressTemp?.country); | |||||
response.data["district"] = getObjectByValue(ComboData.district, "key", response.data.addressTemp?.district); | |||||
response.data["country"] = getObjectByType(ComboData.country, "type", response.data.addressTemp?.country); | |||||
response.data["district"] = getObjectByType(ComboData.district, "type", response.data.addressTemp?.district); | |||||
response.data["addressLine1"] = response.data.addressTemp?.addressLine1; | response.data["addressLine1"] = response.data.addressTemp?.addressLine1; | ||||
response.data["addressLine2"] = response.data.addressTemp?.addressLine2; | response.data["addressLine2"] = response.data.addressTemp?.addressLine2; | ||||
response.data["addressLine3"] = response.data.addressTemp?.addressLine3; | response.data["addressLine3"] = response.data.addressTemp?.addressLine3; | ||||
@@ -67,7 +67,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
if (values.country==null){ | if (values.country==null){ | ||||
setErrorMsg(intl.formatMessage({id: 'pleaseFillInCountry'})) | setErrorMsg(intl.formatMessage({id: 'pleaseFillInCountry'})) | ||||
} else { | } else { | ||||
if (values.country.key ==1 && values.district == null){ | |||||
if (values.country.type == "hongKong" && values.district == null){ | |||||
setErrorMsg(intl.formatMessage({id: 'pleaseFillInDistrict'})) | setErrorMsg(intl.formatMessage({id: 'pleaseFillInDistrict'})) | ||||
} else { | } else { | ||||
HttpUtils.post({ | HttpUtils.post({ | ||||
@@ -89,7 +89,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
}, | }, | ||||
emailAddress: values.emailAddress, | emailAddress: values.emailAddress, | ||||
address: { | address: { | ||||
country: values.country.key, | |||||
country: values.country.type, | |||||
district: values.district?.type, | district: values.district?.type, | ||||
addressLine1: values.addressLine1, | addressLine1: values.addressLine1, | ||||
addressLine2: values.addressLine2, | addressLine2: values.addressLine2, | ||||
@@ -70,7 +70,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { | |||||
if (values.country==null){ | if (values.country==null){ | ||||
setErrorMsg(intl.formatMessage({id: 'pleaseFillInCountry'})) | setErrorMsg(intl.formatMessage({id: 'pleaseFillInCountry'})) | ||||
} else { | } else { | ||||
if (values.country.key ==1 && values.district == null){ | |||||
if (values.country.type == "hongKong" && values.district == null){ | |||||
setErrorMsg(intl.formatMessage({id: 'pleaseFillInDistrict'})) | setErrorMsg(intl.formatMessage({id: 'pleaseFillInDistrict'})) | ||||
} else { | } else { | ||||
HttpUtils.post({ | HttpUtils.post({ | ||||
@@ -87,7 +87,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { | |||||
faxNumber: values.faxNumber | faxNumber: values.faxNumber | ||||
}, | }, | ||||
address: { | address: { | ||||
country: values.country.key, | |||||
country: values.country.type, | |||||
district: values.district?.type, | district: values.district?.type, | ||||
addressLine1: values.addressLine1, | addressLine1: values.addressLine1, | ||||
addressLine2: values.addressLine2, | addressLine2: values.addressLine2, | ||||
@@ -23,7 +23,7 @@ const BackgroundHead = { | |||||
} | } | ||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
import {getObjectByValue,getObjectByType} from "utils/CommonFunction"; | |||||
import {getObjectByType} from "utils/CommonFunction"; | |||||
import * as ComboData from "utils/ComboData"; | import * as ComboData from "utils/ComboData"; | ||||
const LoadingComponent = Loadable(React.lazy(() => import('../../extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(React.lazy(() => import('../../extra-pages/LoadingComponent'))); | ||||
const UserInformationCard = Loadable(React.lazy(() => import('./UserInformationCard_Individual'))); | const UserInformationCard = Loadable(React.lazy(() => import('./UserInformationCard_Individual'))); | ||||
@@ -75,7 +75,7 @@ const UserMaintainPage_Individual = () => { | |||||
response.data["modifieDate"] = modifiedBy; | response.data["modifieDate"] = modifiedBy; | ||||
response.data["verifiedStatus"] = response.data.verifiedBy ? DateUtils.datetimeStr(response.data.verifiedDate) + ", " + response.data.verifiedByName : "Not Verified"; | response.data["verifiedStatus"] = response.data.verifiedBy ? DateUtils.datetimeStr(response.data.verifiedDate) + ", " + response.data.verifiedByName : "Not Verified"; | ||||
response.data["country"] = getObjectByValue(ComboData.country, "key", response.data.address?.country); | |||||
response.data["country"] = getObjectByType(ComboData.country, "type", response.data.address?.country); | |||||
response.data["district"] = getObjectByType(ComboData.district, "type", response.data.address?.district); | response.data["district"] = getObjectByType(ComboData.district, "type", response.data.address?.district); | ||||
response.data["addressLine1"] = response.data.address?.addressLine1; | response.data["addressLine1"] = response.data.address?.addressLine1; | ||||
response.data["addressLine2"] = response.data.address?.addressLine2; | response.data["addressLine2"] = response.data.address?.addressLine2; | ||||
@@ -103,7 +103,7 @@ const UserMaintainPage_Individual = () => { | |||||
response.data["mobileNumber"] = JSON.parse(response.data["mobileNumber"]); | response.data["mobileNumber"] = JSON.parse(response.data["mobileNumber"]); | ||||
response.data["faxNo"] = JSON.parse(response.data["faxNo"]); | response.data["faxNo"] = JSON.parse(response.data["faxNo"]); | ||||
response.data["country"] = getObjectByValue(ComboData.country, "key", response.data.address?.country); | |||||
response.data["country"] = getObjectByType(ComboData.country, "type", response.data.address?.country); | |||||
response.data["district"] = getObjectByType(ComboData.district, "type", response.data.address?.district); | response.data["district"] = getObjectByType(ComboData.district, "type", response.data.address?.district); | ||||
response.data["addressLine1"] = response.data.address?.addressLine1; | response.data["addressLine1"] = response.data.address?.addressLine1; | ||||
response.data["addressLine2"] = response.data.address?.addressLine2; | response.data["addressLine2"] = response.data.address?.addressLine2; | ||||
@@ -21,7 +21,7 @@ import ForwardIcon from '@mui/icons-material/Forward'; | |||||
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
import { useNavigate } from 'react-router-dom'; | import { useNavigate } from 'react-router-dom'; | ||||
import * as ComboData from "utils/ComboData"; | import * as ComboData from "utils/ComboData"; | ||||
import {getObjectByValue,getObjectByType} from "utils/CommonFunction"; | |||||
import {getObjectByType} from "utils/CommonFunction"; | |||||
const LoginGrid = Loadable(React.lazy(() => import('./LoginGrid'))); | const LoginGrid = Loadable(React.lazy(() => import('./LoginGrid'))); | ||||
const BackgroundHead = { | const BackgroundHead = { | ||||
@@ -135,9 +135,7 @@ const UserMaintainPage_Organization = () => { | |||||
response.data["verifiedStatus"] = response.data.verifiedBy ? DateUtils.datetimeStr(response.data.verifiedDate) + ", " + response.data.verifiedByName : "Not Verified"; | response.data["verifiedStatus"] = response.data.verifiedBy ? DateUtils.datetimeStr(response.data.verifiedDate) + ", " + response.data.verifiedByName : "Not Verified"; | ||||
response.data["lastLoginDate"] = response.data.lastLogin ? DateUtils.datetimeStr(response.data.lastLoginDate) : ""; | response.data["lastLoginDate"] = response.data.lastLogin ? DateUtils.datetimeStr(response.data.lastLoginDate) : ""; | ||||
// console.log(getObjectByValue(ComboData.country, "key", response.data.addressBus?.country)) | |||||
// console.log(getObjectByValue(ComboData.country, "key", response.data.addressBus?.district)) | |||||
response.data["country"] = getObjectByValue(ComboData.country, "key", response.data.addressBus?.country); | |||||
response.data["country"] = getObjectByType(ComboData.country, "type", response.data.addressBus?.country); | |||||
response.data["district"] = getObjectByType(ComboData.district, "type", response.data.addressBus?.district); | response.data["district"] = getObjectByType(ComboData.district, "type", response.data.addressBus?.district); | ||||
response.data["addressLine1"] = response.data.addressBus?.addressLine1; | response.data["addressLine1"] = response.data.addressBus?.addressLine1; | ||||
response.data["addressLine2"] = response.data.addressBus?.addressLine2; | response.data["addressLine2"] = response.data.addressBus?.addressLine2; | ||||