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 { isColorModeSet, setColorMode } = useColorModes('coreui-free-react-admin-template-theme')
|
||||
const storedTheme = useSelector((state) => state.theme)
|
||||
const storedTheme = 'light'
|
||||
console.log('theme1', storedTheme)
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -6,6 +6,7 @@ import LocalShippingIcon from '@mui/icons-material/LocalShipping'
|
||||
import CancelIcon from '@mui/icons-material/Cancel'
|
||||
import HourglassEmptyIcon from '@mui/icons-material/HourglassEmpty'
|
||||
import CheckCircleIcon from '@mui/icons-material/CheckCircle'
|
||||
import { isAutheticated } from '../../auth'
|
||||
const Dashboard = () => {
|
||||
const [counts, setCounts] = useState({
|
||||
new: 0,
|
||||
@ -14,12 +15,16 @@ const Dashboard = () => {
|
||||
processing: 0,
|
||||
delivered: 0,
|
||||
})
|
||||
|
||||
const token = isAutheticated()
|
||||
// Fetch counts on component mount
|
||||
useEffect(() => {
|
||||
const getCounts = async () => {
|
||||
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) {
|
||||
console.log('res', res)
|
||||
setCounts(res.data.counts) // Assuming the response is in the format { new, dispatched, cancelled, processing, delivered }
|
||||
|
Loading…
Reference in New Issue
Block a user