From d8c133b5d2a78df0ac4445e8a0959d0a0c6aba91 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Wed, 1 Nov 2023 09:54:53 -0300 Subject: [PATCH] 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. --- src/frontend/src/pages/StorePage/components/market-card.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/pages/StorePage/components/market-card.tsx b/src/frontend/src/pages/StorePage/components/market-card.tsx index b396c822d..c320d965b 100644 --- a/src/frontend/src/pages/StorePage/components/market-card.tsx +++ b/src/frontend/src/pages/StorePage/components/market-card.tsx @@ -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); }); } }