mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: resolve ui unique labels
This commit is contained in:
parent
bac3597614
commit
5b08d9d36f
@ -53,11 +53,11 @@ export const ContentTypeForm: FC<ComponentFormProps<IContentType>> = ({
|
|||||||
name: "fields",
|
name: "fields",
|
||||||
rules: {
|
rules: {
|
||||||
validate: (fields) => {
|
validate: (fields) => {
|
||||||
const hasDuplicatedLabels =
|
const hasUniqueLabels =
|
||||||
new Set(fields.map((f) => f["label"] as string)).size ===
|
new Set(fields.map((f) => f["label"] as string)).size ===
|
||||||
fields.length;
|
fields.length;
|
||||||
|
|
||||||
if (hasDuplicatedLabels) {
|
if (!hasUniqueLabels) {
|
||||||
toast.error(t("message.duplicate_labels_not_allowed"));
|
toast.error(t("message.duplicate_labels_not_allowed"));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user