This commit is contained in:
Malai Raja
2023-12-11 19:00:29 +05:30
parent ecafa8fb25
commit be9d119961
8 changed files with 163 additions and 211 deletions

View File

@@ -65,7 +65,10 @@ const Createclient = () => {
const [primarycontact,setPrimarycontact]=useState('')
const [firstname,setFirstname]=useState('');
const [doorno,setDoorno]=useState('');
const [landmark,setLandmark]=useState('')
const [landmark,setLandmark]=useState('');
const [tenantinfo, setTenantinfo] = useState({});
const navigate = useNavigate();
@@ -78,7 +81,9 @@ const Createclient = () => {
useEffect(() => {
// fetchprofiledetails(localStorage.getItem('appuserid'));
// fetchprofiledetails(181);
if(localStorage.getItem('tenantid')){
fetchtenantinfo(localStorage.getItem('tenantid'))
}
}, [])
useEffect(() => {
@@ -158,6 +163,21 @@ const Createclient = () => {
}
}
const fetchtenantinfo = async (tid) => {
setLoading(true)
await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenantinfo/?tenantid=${tid}`)
.then((res) => {
console.log(res)
if (res.data.status) {
setTenantinfo(res.data.details);
}
setLoading(false)
}).catch((err) => {
console.log(err)
setLoading(false)
})
}
useEffect(() => {
if (selectedImage) {
setAvatar(URL.createObjectURL(selectedImage));
@@ -241,7 +261,7 @@ const Createclient = () => {
"customerid":0,
"configid":1,
"firstname":firstname,
"applocationid":3,
"applocationid":tenantinfo.applolcationid,
"profileimage":"",
"dialcode":"+91",
"contactno":mobilenumber,