fix(market-card.tsx): update setLikes_count and setLiked_by_user with response values to correctly display likes count and user like status
The changes were made to fix a bug where the likes count and user like status were not being displayed correctly on the market card component in the StorePage. The previous code was using the wrong variable to set the likes count and user like status. The fix updates the code to use the correct response values from the API call to set the likes count and user like status.
This commit is contained in:
parent
85647091f7
commit
d8c133b5d2
1 changed files with 4 additions and 2 deletions
|
|
@ -83,8 +83,10 @@ export const MarketCardComponent = ({ data }: { data: storeComponent }) => {
|
|||
list: [error["response"]["data"]["detail"]],
|
||||
});
|
||||
})
|
||||
.then((count) => {
|
||||
setLikes_count(count);
|
||||
.then((response) => {
|
||||
console.log(response);
|
||||
setLikes_count(response.likes_count);
|
||||
setLiked_by_user(response.liked_by_user);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue