A full-featured CRM built with React, shadcn/ui, and Supabase.
fix: Silence tag fetch errors in contact list after a tag deletion
erwanMarmelabc941c80539e4
diff --git a/src/components/atomic-crm/contacts/TagsList.tsx b/src/components/atomic-crm/contacts/TagsList.tsxindex 168989be..619dbb69 100644--- a/src/components/atomic-crm/contacts/TagsList.tsx+++ b/src/components/atomic-crm/contacts/TagsList.tsx@@ -1,5 +1,8 @@import { useRecordContext } from "ra-core";-import { ReferenceArrayField } from "@/components/admin/reference-array-field";+import {+ ReferenceArrayField,+ type ReferenceArrayFieldProps,+} from "@/components/admin/reference-array-field";import { SingleFieldList } from "@/components/admin/single-field-list";import { Badge } from "@/components/ui/badge";import { cn } from "@/lib/utils";@@ -19,12 +22,19 @@ const ColoredBadge = (props: any) => {);};+// Cached contacts may still reference a deleted tag: don't notify about it.+// ra-core forwards onError to useGetManyAggregate, but its queryOptions type doesn't declare it.+const silentQueryOptions = {+ onError: () => {},+} as ReferenceArrayFieldProps["queryOptions"];+export const TagsList = () => (<ReferenceArrayFieldclassName="inline-block"resource="contacts"source="tags"reference="tags"+ queryOptions={silentQueryOptions}><SingleFieldList><ColoredBadge source="name" />