mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Do not validate circular fields (#14996)
This commit is contained in:
@@ -189,6 +189,16 @@ export default defineComponent({
|
||||
}
|
||||
});
|
||||
|
||||
const fieldsWithoutCircular = computed(() => {
|
||||
if (props.circularField) {
|
||||
return fields.value.filter((field) => {
|
||||
return field.field !== props.circularField;
|
||||
});
|
||||
} else {
|
||||
return fields.value;
|
||||
}
|
||||
});
|
||||
|
||||
const templatePrimaryKey = computed(() =>
|
||||
junctionFieldInfo.value ? String(props.relatedPrimaryKey) : String(props.primaryKey)
|
||||
);
|
||||
@@ -396,7 +406,9 @@ export default defineComponent({
|
||||
|
||||
function save() {
|
||||
const editsToValidate = props.junctionField ? internalEdits.value[props.junctionField] : internalEdits.value;
|
||||
const fieldsToValidate = props.junctionField ? junctionRelatedCollectionFields.value : fields.value;
|
||||
const fieldsToValidate = props.junctionField
|
||||
? junctionRelatedCollectionFields.value
|
||||
: fieldsWithoutCircular.value;
|
||||
let errors = validateItem(editsToValidate || {}, fieldsToValidate, isNew.value);
|
||||
|
||||
if (errors.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user