chore: cleanup test fields relationship config (#1635)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import type { CollectionConfig } from '../../../../src/collections/config/types';
|
||||
import { FilterOptionsProps } from '../../../../src/fields/config/types';
|
||||
|
||||
export const relationshipFieldsSlug = 'relationship-fields';
|
||||
|
||||
@@ -17,32 +16,6 @@ const RelationshipFields: CollectionConfig = {
|
||||
type: 'relationship',
|
||||
relationTo: relationshipFieldsSlug,
|
||||
},
|
||||
{
|
||||
name: 'narrowRelationsBy',
|
||||
type: 'select',
|
||||
options: ['text-fields', 'array-fields'],
|
||||
},
|
||||
{
|
||||
name: 'relationshipMany',
|
||||
type: 'relationship',
|
||||
relationTo: ['text-fields', 'array-fields'],
|
||||
hasMany: true,
|
||||
filterOptions: ({ relationTo, siblingData }: any) => {
|
||||
if (siblingData?.narrowRelationsBy === relationTo) {
|
||||
return { and: [] };
|
||||
}
|
||||
|
||||
return {
|
||||
and: [
|
||||
{
|
||||
nonexistentField: {
|
||||
exists: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user