This commit is contained in:
joshikannan
2024-03-14 19:32:31 +05:30
parent a76b3f4819
commit 30b05f9524
2 changed files with 28 additions and 110 deletions

View File

@@ -767,12 +767,12 @@ const Createorder1 = () => {
// clientdetails(localStorage.getItem('tenantid'))
// }
if (localStorage.getItem('partnerid')) {
fetchtenantinfolist(localStorage.getItem('partnerid'));
// fetchtenantinfolist(localStorage.getItem('partnerid'));
}
}, []);
useEffect(() => {
fetchtenantlocation();
// fetchtenantlocation();
clientdetails();
clientdetailsbusiness();
fetchtenantinfo();
@@ -869,7 +869,6 @@ const Createorder1 = () => {
if (res.data.status) {
setTenant(res.data.details);
setTenantid(res.data.details.tenantid);
// fetchadmintoken(res.data.details.tenantid, res.data.details.partnerid);
fetchAppAdminTokens();
}
setLoading(false);
@@ -881,7 +880,7 @@ const Createorder1 = () => {
};
useEffect(() => {
fetchtenantinfo();
fetchtenantlocation();
// fetchtenantlocation();
}, []);
// ==================================================== || fetchTiming || ====================================================
@@ -948,29 +947,29 @@ const Createorder1 = () => {
// });
// };
const fetchtenantlocation = async () => {
setLoading(true);
await axios
.get(`${process.env.REACT_APP_URL}/tenants/gettenantlocations/?tenantid=${tid}`)
.then((res) => {
console.log('fetchtenantlocation', res);
if (res.data.status) {
let arr = [];
res.data.details.map((val) => {
arr.push({
...val,
label: ` ${val.locationname}`
});
});
setTenantlocationlist(arr);
}
setLoading(false);
})
.catch((err) => {
console.log(err);
setLoading(false);
});
};
// const fetchtenantlocation = async () => {
// setLoading(true);
// await axios
// .get(`${process.env.REACT_APP_URL}/tenants/gettenantlocations/?tenantid=${tid}`)
// .then((res) => {
// console.log('fetchtenantlocation', res);
// if (res.data.status) {
// let arr = [];
// res.data.details.map((val) => {
// arr.push({
// ...val,
// label: ` ${val.locationname}`
// });
// });
// setTenantlocationlist(arr);
// }
// setLoading(false);
// })
// .catch((err) => {
// console.log(err);
// setLoading(false);
// });
// };
// // =============================================== || fetchadmintoken (via tid , pid) || ===============================================
// const fetchadmintoken = async (tid, pid) => {