fix: filterable undefined (#2646)

This commit is contained in:
katherinehhh 2023-09-14 14:21:30 +08:00 committed by GitHub
parent 0c132d7940
commit feaf4cd80a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ export const useFilterableFields = (collectionName: string) => {
return false;
}
const fieldInterface = getInterface(field.interface);
if (!fieldInterface.filterable) {
if (!fieldInterface?.filterable) {
return false;
}
return true;

View File

@ -36,7 +36,7 @@ export const useGetFilterFieldOptions = () => {
return;
}
const fieldInterface = getInterface(field.interface);
if (!fieldInterface.filterable) {
if (!fieldInterface?.filterable) {
return;
}
const { nested, children, operators } = fieldInterface.filterable;
@ -93,7 +93,7 @@ export const useFilterFieldOptions = (fields) => {
return;
}
const fieldInterface = getInterface(field.interface);
if (!fieldInterface.filterable) {
if (!fieldInterface?.filterable) {
return;
}
const { nested, children, operators } = fieldInterface.filterable;

View File

@ -39,7 +39,7 @@ const useVariableTypes = (currentCollection, excludes = []) => {
return;
}
const fieldInterface = getInterface(field.interface);
if (!fieldInterface.filterable) {
if (!fieldInterface?.filterable) {
return;
}
const { nested, children } = fieldInterface.filterable;