Skip to content

Convert Search Routes to Ability Delegation #4

Description

@chubes4

Summary

Convert all search-related REST routes to delegate to extrachill-search plugin abilities instead of containing business logic directly.

Current State

  • Search routes contain embedded multisite search logic
  • Direct calls to search functions throughout route handlers
  • No delegation to Abilities API

Routes to Convert

  • GET /wp-json/extrachill/v1/search → delegate to extrachill/multisite-search ability
  • Any other search-related endpoints in the API

Implementation Pattern

function extrachill_api_search_handler($request) {
    $input = extrachill_api_rest_to_ability_input($request, [
        'query' => 'query',
        'blog_id' => 'blog_id',
        'post_type' => 'post_type',
        'per_page' => 'per_page'
    ]);
    
    $result = wp_execute_ability('extrachill/multisite-search', $input);
    return extrachill_api_ability_to_rest_response($result);
}

Success Criteria

  • All search REST endpoints maintain exact same external interface
  • Business logic removed from API plugin and delegated to extrachill-search abilities
  • Backward compatibility maintained for existing consumers
  • Improved performance by removing business logic from API layer

Dependencies

  • Requires completion of "Add Ability Delegation Wrapper Infrastructure" issue
  • extrachill-search plugin abilities already implemented and available

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions