add value formatter to reference field filter

This commit is contained in:
shamsmosowi
2023-01-16 14:58:46 +01:00
parent 9d4161ece7
commit 45ab7aba04
2 changed files with 8 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
import { DocumentReference } from "@google-cloud/firestore";
export const valueFormatter = (value: DocumentReference, operator: string) => {
if (value && value.path) return value.path;
return "";
};

View File

@@ -6,6 +6,7 @@ import { Reference } from "@src/assets/icons";
import DisplayCell from "./DisplayCell";
import EditorCell from "./EditorCell";
import { filterOperators } from "@src/components/fields/ShortText/Filter";
import { valueFormatter } from "./filters";
const SideDrawerField = lazy(
() =>
@@ -27,6 +28,6 @@ export const config: IFieldConfig = {
disablePadding: true,
}),
SideDrawerField,
filter: { operators: filterOperators },
filter: { operators: filterOperators, valueFormatter: valueFormatter },
};
export default config;