From a9655fc6e79ee03b2ead53e6e771a35c8a7216c9 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Wed, 14 Aug 2024 17:25:33 +0200 Subject: [PATCH] ensure property.constraints.planning can't be [] --- .../src/@planx/components/PlanningConstraints/Public.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx b/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx index 05d8888429..e36b9b6b48 100644 --- a/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx +++ b/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx @@ -216,7 +216,7 @@ function Component(props: Props) { _overrides, "planningConstraints.action": userAction, _nots: notsAfterOverrides, - ...intersectingConstraintsAfterOverrides, + ...(intersectingConstraintsAfterOverrides[props.fn]?.length === 0 ? undefined : intersectingConstraintsAfterOverrides), }; props.handleSubmit?.({