orders api updated

This commit is contained in:
joshikannan
2024-12-24 16:17:09 +05:30
parent 9086a42dd7
commit 453bcb2886

View File

@@ -163,8 +163,7 @@ const Orders = () => {
const [order, setOrder] = React.useState('asc'); const [order, setOrder] = React.useState('asc');
const [orderBy, setOrderBy] = React.useState('calories'); const [orderBy, setOrderBy] = React.useState('calories');
const [selected, setSelected] = React.useState([]); const [selected, setSelected] = React.useState([]);
const [page, setPage] = React.useState(0);
const [rowsPerPage, setRowsPerPage] = React.useState(10);
const [expandopen, setExpandopen] = React.useState(''); const [expandopen, setExpandopen] = React.useState('');
const [dialogopen, setDialogopen] = useState(false); const [dialogopen, setDialogopen] = useState(false);
@@ -914,7 +913,7 @@ const Orders = () => {
</Table> </Table>
</TableContainer> </TableContainer>
<TablePagination <TablePagination
rowsPerPageOptions={[10, 25, 50, 100]} rowsPerPageOptions={[1, 10, 25, 50, 100]}
component="div" component="div"
count={rows.length} count={rows.length}
rowsPerPage={rowsPerPage} rowsPerPage={rowsPerPage}
@@ -926,6 +925,8 @@ const Orders = () => {
); );
} }
const tid = localStorage.getItem('tenantid'); const tid = localStorage.getItem('tenantid');
const [page, setPage] = React.useState(0);
const [rowsPerPage, setRowsPerPage] = React.useState(10);
const [startdate, setStartdate] = useState(dayjs().format('YYYY-MM-DD')); const [startdate, setStartdate] = useState(dayjs().format('YYYY-MM-DD'));
const [enddate, setEnddate] = useState(dayjs().format('YYYY-MM-DD')); const [enddate, setEnddate] = useState(dayjs().format('YYYY-MM-DD'));
const [percentage1, setPercentage1] = useState('0'); const [percentage1, setPercentage1] = useState('0');
@@ -1062,7 +1063,11 @@ const Orders = () => {
try { try {
await axios await axios
.get( .get(
`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=${currentStatus}&fromdate=${startdate}&todate=${enddate}` `${
process.env.REACT_APP_URL
}/orders/tenant/getorders/?tenantid=${tid}&status=${currentStatus}&fromdate=${startdate}&todate=${enddate}&pageno=${
page + 1
}&pagesize=${rowsPerPage}`
) )
.then((res) => { .then((res) => {
let arr = []; let arr = [];