Skip to content

Conversation

@Bekiboo
Copy link
Collaborator

@Bekiboo Bekiboo commented Jan 22, 2026

Description of change

Changed from not allowing less than 2 characters to not allowing empty search.

Issue Number

Closes #692

Type of change

  • Fix (a change which fixes an issue)

How the change has been tested

Change NOT tested yet

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

Bug Fixes

  • Reduced search query minimum length requirement from 2 characters to 1 character across all search features, including user search and name-based queries. This enables users to perform more flexible and granular searches.
  • Updated validation error messaging to provide clearer feedback when search input requirements aren't satisfied.

✏️ Tip: You can customize this high-level summary in your review settings.

@Bekiboo Bekiboo self-assigned this Jan 22, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

This PR relaxes the minimum search query length requirement from 2 to 1 character across the Pictique API's user search endpoints and service methods. Error messages are correspondingly updated. The change enables users to initiate searches with single-character queries.

Changes

Cohort / File(s) Summary
Controller
platforms/pictique-api/src/controllers/UserController.ts
Reduced minimum search query length validation from 2 to 1 characters in search and searchByEnameOrName endpoints; updated error message from "Search query must be at least 2 characters long" to "Search query cannot be empty"
Service
platforms/pictique-api/src/services/UserService.ts
Lowered search query validation threshold from 2 to 1 character across multiple methods: searchUsers, getSearchUsersCount, getSearchSuggestions, searchUsersByEnameOrName, getSearchUsersByEnameOrNameCount; updated inline comments to reflect new 1-character rule

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Possibly related PRs

  • Fix/pictique search #342: Modifies the same search validation logic in UserController.ts and UserService.ts, establishing the 2-character minimum that this PR relaxes.
  • fix: search #341: Updates search query validation across identical files, enforcing stricter constraints on the search functionality.

Poem

🐰 One character now unlocks the way,
No longer must users two letters convey!
A query so brief, just a single hop through,
Pictique's search gleams, refreshed and brand new! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating search validation to disallow empty queries rather than queries shorter than 2 characters.
Description check ✅ Passed The description follows the template with all required sections (change description, issue number, type of change, testing, and checklist) mostly complete, though testing was not performed.
Linked Issues check ✅ Passed The code changes successfully implement the requirement from issue #692: relaxing search validation from minimum 2 characters to allowing 1-character queries while still blocking empty queries.
Out of Scope Changes check ✅ Passed All changes are scoped to search validation logic in UserController and UserService, directly addressing the issue requirement with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Bekiboo Bekiboo marked this pull request as ready for review January 22, 2026 06:21
@Bekiboo Bekiboo requested a review from coodos as a code owner January 22, 2026 06:21
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.

[Bug] Pictique: user search fails when query is shorter than 2 characters

2 participants