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; return false;
} }
const fieldInterface = getInterface(field.interface); const fieldInterface = getInterface(field.interface);
if (!fieldInterface.filterable) { if (!fieldInterface?.filterable) {
return false; return false;
} }
return true; return true;

View File

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

View File

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