Skip to content

New endpoint for instant search

Alex requested to merge 798-instant-search-rest into master

Part of #798 (closed)

What does this MR do?

Refactors some parts of the instant search in the topbar:

  • Uses a DTO for search results in the SearchGateway
  • Creates a new endpoint GET /search/all for the instant search in the topbar
  • Removes the client-side wrapper code that mapped the legacy results from the Xhr endpoint
  • Adds a permissions class for searches
  • Makes all affected functions a bit more PHP 7.4 compatible

How confident are you it won't break things if deployed?

Quite sure, seems to work on localhost. The vue front-end already used the new format and doesn't change. The database request and overall behavior shouldn't change as well.

How to test

Steps a reviewer can take to verify that this MR does what it says it does e.g.

  1. Checkout branch locally
  2. Login as foodsaver
  3. Search for a region, store, or another foodsaver in the topbar
  4. Click the results and see if they lead to the correct pages

Checklist

  • added a test, or explain why one is not needed/possible...
  • no unrelated changes
  • asked someone for a code review
  • joined #foodsharing-beta channel at https://slackin.yunity.org
  • added an entry to CHANGELOG.md (description, merge request link, username(s))
  • Once your MR has been merged, you are responsible to update the #foodsharing-beta Slack channel about what has been changed here. They will test your work in different browsers, roles or other settings

Merge request reports

Loading