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: searching issues in payload #387

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

joonatanaatos
Copy link
Contributor

@joonatanaatos joonatanaatos commented Jun 16, 2024

Description

When merging this, make sure to run the migration from the command line into prod!

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time.
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Make sure the commit history is linear, up-to-date with main branch and does not contain any erroneous changes

Formatting and linting

  • Format code with pnpm format and lint the project with pnpm lint

@joonatanaatos joonatanaatos changed the title Fix searching issues in payload fix: searching issues in payload Jun 16, 2024
Copy link
Collaborator

@MikaelSiidorow MikaelSiidorow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two thoughts, but overall looks good! Let's ship it if it works 🚀

export async function up({ payload }: MigrateUpArgs): Promise<void> {
const req = {} as PayloadRequest;

const committeeMembers = await payload.find({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work without specifying a higher limit than default? I suspect there could be a limit here even with pagination false where it wouldn't apply to all items

await payload.update({
collection: NewsItems.slug,
id: item.id,
data: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this change for newsItems probably breaks localization in the admin UI and shows the last saved language version 🤔

It could be fine, but we could also make the field localized and save both locales here, but I wonder if that has even more implications for the search...

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.

None yet

2 participants