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:
anovazzi1 2023-11-01 09:54:53 -03:00
commit d8c133b5d2

View file

@ -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);
});
}
}