🔧 chore(service.py): include 'last_tested_version' field in the list of fields to retrieve from the store API for better tracking of component versions
🐛 fix(FileLoader.py): fix type annotation for loader_import variable to improve code readability and maintainability
🐛 fix(FileLoader.py): handle case when selected_loader_info is not a dict to prevent potential errors
🐛 fix(UrlLoader.py): fix type annotation for build method return value to improve code readability and maintainability
🐛 fix(UrlLoader.py): fix type annotation for loader_instance variables to improve code readability and maintainability
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.
🐛 fix(service.py): fix incorrect variable name in get_component_likes_count method
🐛 fix(service.py): convert likes count to integer to handle unexpected string values
🐛 fix(service.py): convert component_id to string before sending it in the request payload
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.
✨ feat(schema.py): update UsersLikesResponse model to include likes_count and liked_by_user fields
✨ feat(service.py): add get_component_likes_count method to retrieve the number of likes for a component
fix(market-card.tsx): add handleLike function to handle liking a component and update the liked_by_user and likes_count states accordingly
fix(market-card.tsx): update the Heart icon to be filled and have a destructive color if the component is liked by the user
fix(market-card.tsx): update the number of likes to be the likes_count state
fix(StorePage/index.tsx): set setErrorApiKey to false to clear any previous API key error
feat(types/store/index.ts): add liked_by_user property to storeComponent type to indicate if the component is liked by the user
🐛 fix(service.py): remove unused user_data parameter in get_liked_by_user_components function
🐛 fix(utils.py): rename in_users_collection attribute to in_user_collection for consistency
✨ feat(store.py): add support for user_data_context context manager to fetch and set user data for requests made inside the context
✨ feat(store.py): add support for in_user_collection attribute in ListComponentResponse schema to indicate if a component is in the user's collection
🐛 fix(store.py): fix get_liked_by_user_components function to use user_data_var context variable instead of making the request multiple times
🐛 fix(store.py): fix get_components_in_users_collection function to use user_data_var context variable instead of making the request multiple times
✨ feat(store.py): add update_components_with_user_data function to update components with user data (liked_by_user and in_users_collection attributes)
🐛 fix(schema.py): remove default value for liked_by_user attribute in ListComponentResponse
The indentation issue in `store.py` was causing the code to execute the wrong logic. The unnecessary comments were removed to improve code readability.
In `schema.py`, the default value for the `liked_by_user` attribute in the `ListComponentResponse` class was removed to ensure that it is only set when needed.
🔧 fix(schema.py): add liked_by_user field to ListComponentResponse schema
🔧 fix(service.py): add get_liked_by_user_components method to StoreService to retrieve liked components by user
feat(exportModal/index.tsx): modify downloadFlow function to pass an object with id, data, description, and name properties instead of directly passing flow object to improve code readability and maintainability
refactor(StorePage/index.tsx): rename filteredCategories state variable to filteredTags for better semantics
feat(StorePage/index.tsx): add functionality to filter components by tags and update search results accordingly
fix(market-card): refactor totalComponentsMetadata function to improve readability
fix(StorePage): remove unused import and add logic to handle pagination rendering based on search and loading status
The code was removing "page" and "limit" parameters from the params dictionary, but these parameters were not being used afterwards. Removing this unnecessary code improves code readability and maintainability.