-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/press0 1273 typesense index #51
Conversation
includes/MultiSearchController.php
Outdated
$brand = sanitize_text_field( $request->get_param( 'brand' ) ); | ||
$query = sanitize_text_field( $request->get_param( 'query' ) ); | ||
$apiKey = 'B9wvYIokTPPgXEM3isTqsxbDOva21igT'; | ||
$endpoint = 'https://search.hiive.cloud/multi_search?x-typesense-api-key='.$apiKey; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move $apiKey and $endpoint as properties of the class?
includes/MultiSearchController.php
Outdated
* @return \WP_Error | ||
*/ | ||
public function check_permission() { | ||
if ( ! current_user_can( 'read' ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current_user_can( 'manage_options' ) seems a more robust check for this cause the help center is only available in the wordpress admin
https://jira.newfold.com/browse/PRESS0-1273
Added backend endpoint to handle multi-search queries, replacing the direct Typesense API calls from the front end.
Added loader for the multi-search API call.