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(plugin-search): gets api route from useConfig #10632

Merged

Conversation

suphon-t
Copy link
Contributor

This fixes #10631.

Originally the api basepath for the reindex button is resolved during plugin initialization. Looks like this happens before payload overrides the config with the basePath from the next config.
I've changed it so that it uses the useConfig hook, and manually tested that it works.

CleanShot 2568-01-17 at 16 03 16@2x

@suphon-t suphon-t changed the title fix(search): get api route from useConfig fix(plugin-search): get api route from useConfig Jan 17, 2025
@JarrodMFlesch
Copy link
Contributor

Seems good to me. @DanRibbens what do you think?

@jacobsfletch jacobsfletch enabled auto-merge (squash) February 3, 2025 17:52
@jacobsfletch jacobsfletch changed the title fix(plugin-search): get api route from useConfig fix(plugin-search): gets api route from useConfig Feb 3, 2025
@jacobsfletch jacobsfletch disabled auto-merge February 3, 2025 18:02
@jacobsfletch jacobsfletch enabled auto-merge (squash) February 3, 2025 18:02
@jacobsfletch jacobsfletch merged commit 6353cf8 into payloadcms:main Feb 3, 2025
75 of 76 checks passed
jacobsfletch added a commit that referenced this pull request Feb 3, 2025
Continuation of #10632. The `apiBasePath` property in the Search Plugin
config is unnecessary. This plugin reads directly from the Payload
config for this property. Exposing it to the plugin's config was likely
a mistake during sanitization before passing it through to the remaining
files. This property was added to resolve the types, but as result,
exposed it to the config unnecessarily. This PR marks this property with
the deprecated flag to prevent breaking changes.
Copy link
Contributor

github-actions bot commented Feb 5, 2025

🚀 This is included in version v3.21.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't reindex search when using next's basePath option
3 participants