fix(market-card.tsx): fix logic for updating likes_count and liked_by_user state variables
The logic for updating the `likes_count` and `liked_by_user` state variables in the `handleLike` function was incorrect. This commit fixes the logic to correctly update the state variables based on the previous values. Additionally, it adds error handling for the `postLikeComponent` API call and sets the `likes_count` and `liked_by_user` state variables to their previous values in case of an error.
This commit is contained in:
parent
787a725207
commit
4310229c2f
2 changed files with 7 additions and 2 deletions
|
|
@ -6,7 +6,6 @@ from typing import TYPE_CHECKING, List, Dict, Any, Optional, Union
|
|||
import httpx
|
||||
|
||||
from httpx import HTTPError
|
||||
from langflow.services.database.models import user
|
||||
from langflow.services.store.schema import (
|
||||
ComponentResponse,
|
||||
DownloadComponentResponse,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue