@@ -6,17 +6,17 @@ import './SneakerDetails.css'
66const SneakerDetails = ( { data} ) => {
77
88 const { id} = useParams ( ) ;
9- const [ post , setPost ] = useState ( { id : 0 , brand_name : "" , description : "" , sizes : "" , price : "" , img_url : "" } )
9+ const [ post , setPost ] = useState ( { id : 0 , name : "" , description : "" , sizes : "" , price : "" , image_url : "" } )
1010 const [ comments , setComments ] = useState ( [ ] )
1111
1212 useEffect ( ( ) => {
1313 const result = data . filter ( item => item . id === parseInt ( id ) ) [ 0 ] ;
1414
15- setPost ( { id : parseInt ( result . id ) , brand_name : result . brand_name , description : result . description , sizes : result . sizes , price : result . price , img_url : result . img_url } ) ;
15+ setPost ( { id : parseInt ( result . id ) , name : result . name , description : result . description , sizes : result . sizes , price : result . price , image_url : result . image_url } ) ;
1616
1717
1818 const fetchComments = async ( ) => {
19- const response = await fetch ( '/api/comments /' + id )
19+ const response = await fetch ( '/api/reviews /' + id )
2020 const data = await response . json ( )
2121 setComments ( data )
2222 }
@@ -29,20 +29,20 @@ const SneakerDetails = ({data}) => {
2929 return (
3030 < div className = "out" >
3131 < div className = "details-banner" >
32- < h3 className = "brand_name" > { post . brand_name } </ h3 >
32+ < h3 className = "brand_name" > { post . name } </ h3 >
3333 < div className = "details-container" >
3434 < p className = "details-description" > { post . description } </ p >
3535 </ div >
3636 </ div >
3737
3838 < div className = "flex-container" >
39- < div className = "left-side" style = { { backgroundImage :`url(${ post . img_url } )` } } >
39+ < div className = "left-side" style = { { backgroundImage :`url(${ post . image_url } )` } } >
4040 </ div >
4141 < div className = "right-side" >
4242 { /* <p>{"✔️ Sizes: " + post.sizes }</p> */ }
4343 < p className = "details-price" > { "🏷️ Price: " + post . price } </ p >
44- < p className = "right-side-brand_name" > { post . brand_name } </ p >
45- < Link to = { '../../comment/create /' + id } > < button className = "addCommentBtn" > Create Comment </ button > </ Link >
44+ < p className = "right-side-brand_name" > { post . name } </ p >
45+ < Link to = { '../../comment/reviews /' + id } > < button className = "addCommentBtn" > Review </ button > </ Link >
4646 </ div >
4747 </ div >
4848
0 commit comments