Skip to content
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

Merged
merged 18 commits into from
Aug 21, 2024
Merged

Conversation

mamatharao05
Copy link
Contributor

@mamatharao05 mamatharao05 commented Jul 29, 2024

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.

$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;
Copy link
Contributor

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?

* @return \WP_Error
*/
public function check_permission() {
if ( ! current_user_can( 'read' ) ) {
Copy link
Contributor

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

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.

3 participants