update theme mode
Some checks failed
NPM Installation / build (16.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (16.x, windows-latest) (push) Has been cancelled
NPM Installation / build (17.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (17.x, windows-latest) (push) Has been cancelled
NPM Installation / build (18.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (18.x, windows-latest) (push) Has been cancelled
Some checks failed
NPM Installation / build (16.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (16.x, windows-latest) (push) Has been cancelled
NPM Installation / build (17.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (17.x, windows-latest) (push) Has been cancelled
NPM Installation / build (18.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (18.x, windows-latest) (push) Has been cancelled
This commit is contained in:
parent
ea60b6fc5b
commit
4775e655e2
@ -18,7 +18,7 @@ const ForgetPassword = React.lazy(() => import('./views/pages/forgetPassword'))
|
|||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
const { isColorModeSet, setColorMode } = useColorModes('coreui-free-react-admin-template-theme')
|
const { isColorModeSet, setColorMode } = useColorModes('coreui-free-react-admin-template-theme')
|
||||||
const storedTheme = useSelector((state) => state.theme)
|
const storedTheme = 'light'
|
||||||
console.log('theme1', storedTheme)
|
console.log('theme1', storedTheme)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -6,6 +6,7 @@ import LocalShippingIcon from '@mui/icons-material/LocalShipping'
|
|||||||
import CancelIcon from '@mui/icons-material/Cancel'
|
import CancelIcon from '@mui/icons-material/Cancel'
|
||||||
import HourglassEmptyIcon from '@mui/icons-material/HourglassEmpty'
|
import HourglassEmptyIcon from '@mui/icons-material/HourglassEmpty'
|
||||||
import CheckCircleIcon from '@mui/icons-material/CheckCircle'
|
import CheckCircleIcon from '@mui/icons-material/CheckCircle'
|
||||||
|
import { isAutheticated } from '../../auth'
|
||||||
const Dashboard = () => {
|
const Dashboard = () => {
|
||||||
const [counts, setCounts] = useState({
|
const [counts, setCounts] = useState({
|
||||||
new: 0,
|
new: 0,
|
||||||
@ -14,12 +15,16 @@ const Dashboard = () => {
|
|||||||
processing: 0,
|
processing: 0,
|
||||||
delivered: 0,
|
delivered: 0,
|
||||||
})
|
})
|
||||||
|
const token = isAutheticated()
|
||||||
// Fetch counts on component mount
|
// Fetch counts on component mount
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const getCounts = async () => {
|
const getCounts = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await Axios.get('/api/get-counts-pdOrders') // Updated API endpoint
|
const res = await Axios.get('/api/get-counts-pdOrders', {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
},
|
||||||
|
}) // Updated API endpoint
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
console.log('res', res)
|
console.log('res', res)
|
||||||
setCounts(res.data.counts) // Assuming the response is in the format { new, dispatched, cancelled, processing, delivered }
|
setCounts(res.data.counts) // Assuming the response is in the format { new, dispatched, cancelled, processing, delivered }
|
||||||
|
Loading…
Reference in New Issue
Block a user