@@ -20,10 +20,11 @@ export const AdFeed=({_id, price, owner,title,description,images,comments}) => {
<p>{`${price ? price : "0"} грн.`}</p>
</div>
<div>
- <p>{comments || null}</p>
+ <p>{`Коментарии : ${comments ? comments[0]?.text : 'отсутвуют'}`}</p>
+ <p>{`От : ${comments ? comments[0].owner.login : '-'}`}</p>
</Container>
)
}
-export const CAdfeed = connect(state=>({comments: state.promiseReducer.AdFind?.payload?.data?.AdFind.comments[0]?.owner}))(AdFeed)
+// export const CAdfeed = connect(state=>({comments: state.promiseReducer.AdFind?.payload?.data?.AdFind.comments[0]?.owner}))(AdFeed)
@@ -98,7 +98,7 @@ export const actionTypeAd = (_id,title) =>
url
comments {
- _id text owner { login}
+ _id text owner {login} answerTo { owner { login}}
@@ -13,7 +13,7 @@ export const Home = ({getData,data2}) => {
if(data2){
return (
- {data2.map(ad => <AdFeed key={ad._id} _id = {ad. _id} price = {ad.price} title = {ad.title} description={ad.description} owner={ad.owner} images={ad.images} />)}
+ {data2.map(ad => <AdFeed key={ad._id} _id = {ad. _id} price = {ad.price} title = {ad.title} description={ad.description} owner={ad.owner} images={ad.images} comments={ad.comments} />)}