initialisation on the doormile express console with astryx
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import {
|
||||
Autocomplete,
|
||||
Button,
|
||||
@@ -25,14 +26,14 @@ import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import dayjs from 'dayjs';
|
||||
import MainCard from 'components/MainCard';
|
||||
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
||||
import { fetchPaymentType, fetchRidersList, finalCreatedeliveries, notifyRider } from 'pages/api/api';
|
||||
import { fetchPaymentType, fetchRidersList, finalCreatedeliveries, notifyRider } from '../../api/api';
|
||||
import { OpenToast } from 'components/third-party/OpenToast';
|
||||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
import Loader from 'components/Loader';
|
||||
import CircularLoader from 'components/CircularLoader';
|
||||
import { Empty } from 'antd';
|
||||
import HoverSocialCard from 'components/cards/statistics/HoverSocialCard';
|
||||
import { DashboardFilled, OpenAIFilled } from '@ant-design/icons';
|
||||
import { DashboardFilled } from '@ant-design/icons';
|
||||
import { MdDirectionsBike } from 'react-icons/md';
|
||||
import { FaMapLocationDot } from 'react-icons/fa6';
|
||||
import { HiOutlineArrowLeft } from 'react-icons/hi';
|
||||
@@ -234,9 +235,7 @@ const OrdersPreview = () => {
|
||||
|
||||
const {
|
||||
data: paymentModes = [],
|
||||
isLoading: paymentModesLoading,
|
||||
isError: paymentModesError,
|
||||
error: paymentModesErrorMessage
|
||||
isLoading: paymentModesLoading
|
||||
} = useQuery({
|
||||
queryKey: ['paymentmodes'],
|
||||
queryFn: fetchPaymentType
|
||||
@@ -246,10 +245,7 @@ const OrdersPreview = () => {
|
||||
|
||||
const {
|
||||
data: ridersList = [],
|
||||
isLoading: ridersListLoading,
|
||||
isError: ridersListError,
|
||||
error: ridersListErrorMessage,
|
||||
refetch: ridersListRefetch
|
||||
isLoading: ridersListLoading
|
||||
} = useQuery({
|
||||
queryKey: ['ridersList', appId], // Unique key for caching & re-fetching
|
||||
queryFn: fetchRidersList,
|
||||
@@ -282,13 +278,13 @@ const OrdersPreview = () => {
|
||||
onSuccess: (data, variables) => {
|
||||
console.log('data', data);
|
||||
console.log('varialbles', variables);
|
||||
notifyRiderMutation.mutate(rider.userfcmtoken || riderToken); // Call notifyRider after success
|
||||
notifyRiderMutation.mutate(rider?.userfcmtoken || riderToken); // Call notifyRider after success
|
||||
if (data.status == 'accepted') {
|
||||
OpenToast('Delivery Created Successfully', 'success', 2000);
|
||||
}
|
||||
setTimeout(() => {
|
||||
setIsLoading(false);
|
||||
navigate('/nearle/deliveries');
|
||||
navigate('/nearle/orders');
|
||||
}, 2000);
|
||||
},
|
||||
onError: (error) => {
|
||||
@@ -581,11 +577,6 @@ const OrdersPreview = () => {
|
||||
<TableCell>
|
||||
<Typography> {index + 1}</Typography>
|
||||
</TableCell>
|
||||
{/* {aiMode == 1 && (
|
||||
<TableCell>
|
||||
<Chip color="primary" label={val.zone_name} />
|
||||
</TableCell>
|
||||
)} */}
|
||||
<TableCell>
|
||||
<Tooltip title={val.tenantaddress}>
|
||||
<Typography variant="body1" noWrap>
|
||||
@@ -656,12 +647,6 @@ const OrdersPreview = () => {
|
||||
</Stack>
|
||||
</TableCell>
|
||||
<TableCell align="left">{val.ordernotes}</TableCell>
|
||||
{/* {aiMode == 1 && (
|
||||
<TableCell align="left">
|
||||
<Typography sx={{ whiteSpace: 'nowrap' }}>{val.username}</Typography>
|
||||
<Typography>ID : {val.userid}</Typography>
|
||||
</TableCell>
|
||||
)} */}
|
||||
<TableCell align="center">
|
||||
<Chip
|
||||
size="small"
|
||||
@@ -774,7 +759,7 @@ const OrdersPreview = () => {
|
||||
disabled={aiMode === 0 && (!rider || !payment)}
|
||||
onClick={handleManualCreateDelivery}
|
||||
>
|
||||
Assign Orders
|
||||
Finalise
|
||||
</Button>
|
||||
</Stack>
|
||||
</MainCard>
|
||||
|
||||
Reference in New Issue
Block a user