diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/detection/_components/DetectionPatternRow.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/detection/_components/DetectionPatternRow.tsx index 0b803100e..81ccc331b 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/detection/_components/DetectionPatternRow.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/detection/_components/DetectionPatternRow.tsx @@ -195,6 +195,11 @@ export function DetectionPatternRow({ patternKey, connectionId }: DetectionPatte }, }, updater(store) { + const payload = store.getRootField("moveCookiePatternToCategory"); + if (!payload?.getLinkedRecord("cookiePattern")) { + return; + } + const conn = store.get(connectionId); if (conn) { ConnectionHandler.deleteNode(conn, pattern.id); diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/display/_components/CategorySection.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/display/_components/CategorySection.tsx index 8e941492c..684b4505e 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/display/_components/CategorySection.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/display/_components/CategorySection.tsx @@ -562,6 +562,11 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr const above = allCategories[selfIndex - 1]; reorderCategory({ variables: { input: { cookieCategoryId: category.id, rank: above.rank } }, + onCompleted(_, errors) { + if (errors?.length) { + toast({ title: __("Error"), description: errors[0].message, variant: "error" }); + } + }, onError(error) { toast({ title: __("Error"), description: formatError(__("Failed to reorder"), error as GraphQLError), variant: "error" }); }, @@ -573,6 +578,11 @@ export function CategorySection({ categoryKey, connectionId }: CategorySectionPr const below = allCategories[selfIndex + 1]; reorderCategory({ variables: { input: { cookieCategoryId: category.id, rank: below.rank } }, + onCompleted(_, errors) { + if (errors?.length) { + toast({ title: __("Error"), description: errors[0].message, variant: "error" }); + } + }, onError(error) { toast({ title: __("Error"), description: formatError(__("Failed to reorder"), error as GraphQLError), variant: "error" }); },