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

feat(ui): update RelationshipFilter if only filterOptions are changed #11985

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ruslan-amboss
Copy link

What?

Extends trigger of a reload of the fields for RelationshipFilter to include filterOptions.

Why?

If you have two or more relationship fields that have a relation to the same collection, the options of the filter will not update.

How

By extending dependencies of useEffect

Code setup:

{
    name: 'media',
    type: 'relationship',
    relationTo: 'media',
    filterOptions: () => {
      return {
        id: { in: ['67efaee24648d01dffceecf9'] },
      }
    }
  },
  {
    name: 'media2',
    type: 'relationship',
    relationTo: 'media',
    filterOptions: () => {
      return {
        id: { in: ['67efafb04648d01dffceed75'] },
      }
    }
  },

Before:

before1.mov

After:

after1.mov

-->

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.

1 participant