Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove PostCategory #1354

Merged
merged 3 commits into from
Dec 13, 2024
Merged

Conversation

matiasleyba
Copy link
Contributor

Description

As part of #1348, categories will be transitioned from being an enum to an object class. This change allows categories to be dynamically defined by the backend.
As a result, the PostCategory enum has been removed since its values will no longer align with dynamically defined categories.

Key Changes

  • API
    The PostCategory enum is removed and replaced with the category id to align with the dynamic structure.

  • App
    Any UI Block that previously relied on PostCategory now includes a categoryId to support dynamic categories.
    The name of the category is resolved using the CategoriesBloc state, which stores all fetched categories.

  • Bloc Placement:
    The CategoriesBloc has been moved higher in the widget tree to make its data accessible across different screens, such as the ArticleDetailsPage.

  • Hydrated Bloc Update:
    The CategoriesBloc is no longer a hydrated bloc because categories are dynamic and storing them locally is unnecessary. The backend might change or update them at any time.

📝 Note
The refactor of Category into an object class will be handled in a subsequent PR. This PR focuses first on refactoring PostCategory, with the Category refactor to follow later, ensuring the changes remain manageable and the PR size is kept reasonable.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@matiasleyba matiasleyba self-assigned this Nov 28, 2024
@matiasleyba matiasleyba marked this pull request as ready for review December 6, 2024 20:48
@matiasleyba matiasleyba requested a review from marwfair December 6, 2024 20:48
Copy link

@marwfair marwfair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@matiasleyba matiasleyba merged commit b2cc6c5 into main Dec 13, 2024
9 checks passed
@matiasleyba matiasleyba deleted the refactor/post-category-remove branch December 13, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants