Skip to content

Conversation

@Reaganz-Wat
Copy link

@Reaganz-Wat Reaganz-Wat commented Mar 1, 2025

Pull Request

Description

This PR introduces a new search functionality for the BlogCategoryService, allowing users to search for blog categories by name. The search is case-insensitive and supports partial matching, improving the user experience and content discoverability. Additionally, comprehensive unit tests have been added to ensure the functionality works as expected.
Key changes:

  • Added a new searchCategories method to BlogCategoryService.
  • Implemented case-insensitive and partial matching using TypeORM's createQueryBuilder.
  • Added unit tests for the search functionality, covering edge cases like empty search terms, special characters, and no matches.
  • Updated the API documentation to reflect the new search endpoint.

Related Issue

Fixes #1290

Type of Change

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation updates
  • style: Code style/formatting changes
  • refactor: Code refactoring
  • perf: Performance improvements
  • test: Test additions/updates
  • chore: Build process or tooling changes
  • ci: CI configuration changes
  • other:

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual tests

Test Evidence

All unit tests are passing. Below is a screenshot of the test results:
Test Results Screenshot
Postman test
Postman test

Screenshots (if applicable)

Documentation Screenshots (if applicable)

Checklist

  • My code follows the project's coding style
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have included a screenshot showing all tests passing
  • I have included documentation screenshots (if applicable)

Additional Notes

  • The API endpoint for searching blog categories has been documented using Swagger annotations.
  • Edge cases like empty search terms and special characters have been handled gracefully.

@Reaganz-Wat Reaganz-Wat force-pushed the hng_backend_project branch 3 times, most recently from f424356 to 0a6733c Compare March 1, 2025 18:44
@Reaganz-Wat Reaganz-Wat force-pushed the hng_backend_project branch from ba2a0a0 to 40780e9 Compare March 2, 2025 09:41
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.

[FEAT] Search Functionality for Blog Categories

1 participant