File tree Expand file tree Collapse file tree 2 files changed +65
-5
lines changed
src/components/pages/PageProducts/components Expand file tree Collapse file tree 2 files changed +65
-5
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,11 @@ import Grid from '@material-ui/core/Grid';
7
7
import Typography from '@material-ui/core/Typography' ;
8
8
import { makeStyles } from '@material-ui/core/styles' ;
9
9
import { Product } from "models/Product" ;
10
- import axios from 'axios' ;
11
10
import { formatAsPrice } from "utils/utils" ;
12
11
import AddProductToCart from "components/AddProductToCart/AddProductToCart" ;
13
- import API_PATHS from "constants/apiPaths" ;
12
+ // import axios from 'axios';
13
+ // import API_PATHS from "constants/apiPaths";
14
+ import productList from "./productList.json" ;
14
15
15
16
const useStyles = makeStyles ( ( theme ) => ( {
16
17
card : {
@@ -35,8 +36,9 @@ export default function Products() {
35
36
const [ products , setProducts ] = useState < Product [ ] > ( [ ] ) ;
36
37
37
38
useEffect ( ( ) => {
38
- axios . get ( `${ API_PATHS . bff } /product/available/` )
39
- . then ( res => setProducts ( res . data ) ) ;
39
+ // axios.get(`${API_PATHS.bff}/product/available/`)
40
+ // .then(res => setProducts(res.data));
41
+ setProducts ( productList ) ;
40
42
} , [ ] )
41
43
42
44
return (
@@ -65,4 +67,4 @@ export default function Products() {
65
67
) ) }
66
68
</ Grid >
67
69
) ;
68
- }
70
+ }
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "count" : 4 ,
4
+ "description" : " Short Product Description1" ,
5
+ "id" : " 7567ec4b-b10c-48c5-9345-fc73c48a80aa" ,
6
+ "price" : 2.4 ,
7
+ "title" : " ProductOne"
8
+ },
9
+ {
10
+ "count" : 6 ,
11
+ "description" : " Short Product Description3" ,
12
+ "id" : " 7567ec4b-b10c-48c5-9345-fc73c48a80a0" ,
13
+ "price" : 10 ,
14
+ "title" : " ProductNew"
15
+ },
16
+ {
17
+ "count" : 7 ,
18
+ "description" : " Short Product Description2" ,
19
+ "id" : " 7567ec4b-b10c-48c5-9345-fc73c48a80a2" ,
20
+ "price" : 23 ,
21
+ "title" : " ProductTop"
22
+ },
23
+ {
24
+ "count" : 12 ,
25
+ "description" : " Short Product Description7" ,
26
+ "id" : " 7567ec4b-b10c-48c5-9345-fc73c48a80a1" ,
27
+ "price" : 15 ,
28
+ "title" : " ProductTitle"
29
+ },
30
+ {
31
+ "count" : 7 ,
32
+ "description" : " Short Product Description2" ,
33
+ "id" : " 7567ec4b-b10c-48c5-9345-fc73c48a80a2" ,
34
+ "price" : 23 ,
35
+ "title" : " Product"
36
+ },
37
+ {
38
+ "count" : 8 ,
39
+ "description" : " Short Product Description4" ,
40
+ "id" : " 7567ec4b-b10c-48c5-9345-fc73348a80a1" ,
41
+ "price" : 15 ,
42
+ "title" : " ProductTest"
43
+ },
44
+ {
45
+ "count" : 2 ,
46
+ "description" : " Short Product Descriptio1" ,
47
+ "id" : " 7567ec4b-b10c-48c5-9445-fc73c48a80a2" ,
48
+ "price" : 23 ,
49
+ "title" : " Product2"
50
+ },
51
+ {
52
+ "count" : 3 ,
53
+ "description" : " Short Product Description7" ,
54
+ "id" : " 7567ec4b-b10c-45c5-9345-fc73c48a80a1" ,
55
+ "price" : 15 ,
56
+ "title" : " ProductName"
57
+ }
58
+ ]
You can’t perform that action at this time.
0 commit comments