From 0168f189781e8551846ea5a0ba4ad27e621632b1 Mon Sep 17 00:00:00 2001 From: Sidney Alcantara Date: Mon, 10 Jan 2022 12:52:27 +1100 Subject: [PATCH] table settings: disable unique id check in edit mode --- src/components/TableSettings/form.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/TableSettings/form.tsx b/src/components/TableSettings/form.tsx index a3c5cc2d..f985c983 100644 --- a/src/components/TableSettings/form.tsx +++ b/src/components/TableSettings/form.tsx @@ -177,14 +177,17 @@ export const tableSettings = ( }.`, disabled: mode === TableSettingsDialogModes.update, gridCols: { xs: 12, sm: 6 }, - validation: [ - [ - "test", - "unique", - "Another table exists with this ID", - (value) => !_find(tables, ["value", value]), - ], - ], + validation: + mode === TableSettingsDialogModes.create + ? [ + [ + "test", + "unique", + "Another table exists with this ID", + (value) => !_find(tables, ["value", value]), + ], + ] + : [], }, { step: "display",