Fix relation validation

This commit is contained in:
Daniel Lautzenheiser 2022-09-30 22:45:09 -04:00
parent 84613f3571
commit 3f7e4187cc
2 changed files with 7 additions and 2 deletions

View File

@ -9,7 +9,7 @@ import { FixedSizeList } from 'react-window';
import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc';
import { reactSelectStyles } from '../../ui';
import { stringTemplate, validations } from '../../lib/widgets';
import { stringTemplate } from '../../lib/widgets';
function arrayMove(array, from, to) {
const slicedArray = array.slice();

View File

@ -1,6 +1,11 @@
import controlComponent from './RelationControl';
import previewComponent from './RelationPreview';
import schema from './schema';
import { validations } from '../../lib/widgets';
function isMultiple(field) {
return field.get('multiple', false);
}
function Widget(opts = {}) {
return {
@ -11,7 +16,7 @@ function Widget(opts = {}) {
const min = field.get('min');
const max = field.get('max');
if (!this.isMultiple()) {
if (!isMultiple(field)) {
return { error: false };
}