Skip to content

Remove obsolete POST search endpoints for workshops and resources#1035

Merged
maebeale merged 2 commits into
mainfrom
copilot/remove-old-workshops-endpoint
Feb 15, 2026
Merged

Remove obsolete POST search endpoints for workshops and resources#1035
maebeale merged 2 commits into
mainfrom
copilot/remove-old-workshops-endpoint

Conversation

Copilot AI commented Feb 15, 2026

Copy link
Copy Markdown
Contributor

What is the goal of this PR and why is this important?

Remove old search code that we're not using anymore.

The codebase has migrated to Turbo Frame-based search but retained obsolete POST endpoints (/workshops/search, /resources/search) and their supporting infrastructure. This PR removes 136 lines of dead code.

How did you approach the change?

Removed unused code paths:

  • Service layer: Deleted app/services/search.rb - legacy search class only referenced by removed actions
  • Controllers: Removed search actions and supporting methods (workshops_per_page, view_all_workshops?, load_sortable_fields, load_metadata, process_search, search_params)
  • Routes: Removed post :search collection routes for both resources
  • Frontend: Cleaned up obsolete path references in side_nav.js

Modern equivalents already in use:

  • Workshops: WorkshopSearchService invoked by index action
  • Resources: search_by_params scope with Turbo frame rendering

Anything else to add?

No forms POST to these endpoints. Existing system tests validate the current Turbo-based approach.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: maebeale <7607813+maebeale@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove old workshops search endpoint and related unused code Remove obsolete POST search endpoints for workshops and resources Feb 15, 2026
Copilot AI requested a review from maebeale February 15, 2026 18:13
@maebeale

Copy link
Copy Markdown
Collaborator

@copilot were there any views? or things in decorators that were used only in search?

@maebeale maebeale marked this pull request as ready for review February 15, 2026 18:54

Copilot AI commented Feb 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot were there any views? or things in decorators that were used only in search?

Good catch! I found one unused decorator method:

ResourcesDecorator.search_page (app/decorators/resources_decorator.rb) - references params[:search][:page] but was never actually used because:

  • The old search action didn't decorate the collection (only individual resources get decorated in this controller)
  • No views reference this method

Views: Both old search actions rendered the :index view which now uses Turbo frames exclusively. The index views don't depend on any of the removed variables (@sortable_fields, @metadata, @query).

Should I remove the unused search_page method from ResourcesDecorator?

@maebeale maebeale merged commit 8f0ba8f into main Feb 15, 2026
4 checks passed
@maebeale maebeale deleted the copilot/remove-old-workshops-endpoint branch February 15, 2026 19:01
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