createOrder

This commit is contained in:
joshikannan
2024-04-01 20:17:03 +05:30
parent 30b05f9524
commit 3a255749bb
12 changed files with 2208 additions and 1430 deletions

View File

@@ -52,10 +52,10 @@ export const fetchAllTenants = async ({ queryKey }) => {
let url = '';
if (search) {
// url = `https://jupiter.nearle.app/live/api/v1/tenants/search/?keyword=${search}`;
// url = `${process.env.REACT_APP_URL}/tenants/search/?keyword=${search}`;
url = `${process.env.REACT_APP_URL}/tenants/search/?keyword=${search}`;
} else {
// url = `https://jupiter.nearle.app/live/api/v1/tenants/getalltenants?pageno=${pageno}&pagesize=${size}`;
// url = `${process.env.REACT_APP_URL}/tenants/getalltenants?pageno=${pageno}&pagesize=${size}`;
url = `${process.env.REACT_APP_URL}/tenants/getalltenants?pageno=${pageno}&pagesize=${size}`;
}
const response = await axios.get(url);
@@ -139,9 +139,9 @@ export const fetchorderdetails = async ({ queryKey }) => {
let status = tabValue === 0 ? 'delivered' : tabValue === 1 ? 'pending' : 'cancelled';
const response = await axios.get(
// appId == -1
// ? `https://jupiter.nearle.app/live/api/v1/orders/getorders/?fromdate=${startdate}&todate=${enddate}`
// : `https://jupiter.nearle.app/live/api/v1/orders/getorders/?fromdate=${startdate}&todate=${enddate}&applocationid=${appId}`
`https://jupiter.nearle.app/live/api/v1/deliveries/getdeliveries/?tenantid=${tenid}&fromdate=${startdate}&todate=${enddate}`
// ? `${process.env.REACT_APP_URL}/orders/getorders/?fromdate=${startdate}&todate=${enddate}`
// : `${process.env.REACT_APP_URL}/orders/getorders/?fromdate=${startdate}&todate=${enddate}&applocationid=${appId}`
`${process.env.REACT_APP_URL}/deliveries/getdeliveries/?tenantid=${tenid}&fromdate=${startdate}&todate=${enddate}`
);
console.log('fetchorderdetails', response.data.details);
@@ -151,7 +151,7 @@ export const fetchorderdetails = async ({ queryKey }) => {
export const fetchCount = async ({ queryKey }) => {
console.log('queryKey of fetchCount', queryKey);
const [startdate, enddate] = queryKey;
const response = await axios.get(`https://jupiter.nearle.app/live/api/v1/orders/getorders/?fromdate=${startdate}&todate=${enddate}`);
const response = await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?fromdate=${startdate}&todate=${enddate}`);
const calculateOrderCounts = () => {
let deliveredCount = 0;
let pendingCount = 0;