prevent user creating table with / in ID (#857, #858)

This commit is contained in:
Sidney Alcantara
2022-10-12 10:48:03 +11:00
parent a2dacd9f98
commit 72f7e4e9b5

View File

@@ -215,8 +215,9 @@ export const tableSettings = (
}.`,
disabled: mode === "update",
gridCols: { xs: 12, sm: 6 },
validation:
mode === "create"
validation: [
["matches", /^[^/]+$/g, "ID cannot have /"],
...(mode === "create"
? [
[
"test",
@@ -225,7 +226,8 @@ export const tableSettings = (
(value: any) => !find(tables, ["value", value]),
],
]
: [],
: []),
],
},
{
step: "display",