Skip to content

Add search by last name and show all owners endpoints with pagination#2335

Open
marcosgdz03 wants to merge 1 commit intospring-projects:mainfrom
marcosgdz03:feature/owners-search-pagination
Open

Add search by last name and show all owners endpoints with pagination#2335
marcosgdz03 wants to merge 1 commit intospring-projects:mainfrom
marcosgdz03:feature/owners-search-pagination

Conversation

@marcosgdz03
Copy link
Copy Markdown

This PR introduces new functionality to the PetClinic application to improve the owners search experience. It separates search by last name from listing all owners, and enhances the findOwners.html template to support these features.

Key Changes

  1. New Endpoints

    • /owners/searchByLastName – Searches owners by last name.
    • /owners/showAll – Displays all owners with pagination.
  2. Controller Update

    • Updated OwnerController.java to include the new endpoints.
    • Refactored processFindForm for better handling of searches and empty results.
    • Added listAllOwners method for displaying all owners.
  3. Template Update

    • Updated findOwners.html:
      • Added buttons for Search, Show All Owners, and Add Owner.
      • All hardcoded text replaced with internationalized messages.
  4. Tests

    • Existing tests were updated to match new endpoints and flows.
    • Verified pagination behavior for both single and multiple results.

Benefits

  • Improved user experience by clearly distinguishing between searching by last name and listing all owners.
  • Fully compatible with existing owner creation and editing flows.
  • Ensures proper handling of empty search results with user-friendly messages.

Checklist

  • OwnerController.java updated
  • findOwners.html updated with messages
  • New endpoints tested and verified
  • Existing unit tests updated for new flow
  • Manual verification of search and pagination

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.

1 participant