Skip to content

Commit

Permalink
User Store Populate
Browse files Browse the repository at this point in the history
  • Loading branch information
JAYDIPSINH27 committed Nov 10, 2021
1 parent f7f4bd4 commit 0954f81
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
25 changes: 19 additions & 6 deletions client/src/components/Dashboard/DashboardHome.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@ const useStyles = makeStyles((theme) => ({
paddingTop: theme.spacing(10),
paddingBottom: theme.spacing(2),
},
box:{
box1:{
boxShadow : "1px 3px 3px grey",
borderRadius : "20px",
height: "200px",
width: "400px",

},
box2:{
boxShadow : "1px 3px 3px grey",
borderRadius : "20px",

},
chart:{

},
text: {
display: "flex",
Expand Down Expand Up @@ -92,6 +102,9 @@ function DashboardHome() {

const productnum=()=>{
var count=0;
user.user.stores.map((product)=>{
count+=product.products.length
})

return count;

Expand All @@ -111,7 +124,7 @@ function DashboardHome() {
<Grid item xs={12} sm={6} md={4}>

<Box
className={classes.box}
className={classes.box1}
display="flex"
justifyContent="center"
alignItems="center"
Expand All @@ -124,7 +137,7 @@ function DashboardHome() {
<Grid item xs={12} sm={6} md={4}>

<Box
className={classes.box}
className={classes.box1}
display="flex"
justifyContent="center"
alignItems="center"
Expand All @@ -137,12 +150,12 @@ function DashboardHome() {
<Grid item xs={12} sm={6} md={4}>

<Box
className={classes.box}
className={classes.box1}
display="flex"
justifyContent="center"
alignItems="center"
>
<DateTime />
<Typography variant="h6" className={classes.text}>Total Stores:{user.user.stores.length}</Typography>
</Box>

</Grid>
Expand All @@ -155,7 +168,7 @@ function DashboardHome() {

<Grid item xs={12} sm={6} md={4}>
<Box
className={classes.box}
className={classes.box2}
display="flex"
justifyContent="center"
alignItems="center"
Expand Down
6 changes: 5 additions & 1 deletion server/utils/populateObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ module.exports = {
}
}
},

{
path:'stores',
select:'name description addresses rating products '
}

],

orderPopulate : [
Expand Down

0 comments on commit 0954f81

Please sign in to comment.