Allow and ignore null schema in field update

Fixes #4254
This commit is contained in:
rijkvanzanten
2021-02-23 17:06:35 -05:00
parent 0eb7f01a3e
commit 3d33b9db55
2 changed files with 7 additions and 3 deletions

View File

@@ -74,7 +74,9 @@ const newFieldSchema = Joi.object({
default_value: Joi.any(),
max_length: [Joi.number(), Joi.string(), Joi.valid(null)],
is_nullable: Joi.bool(),
}).unknown(),
})
.unknown()
.allow(null),
meta: Joi.any(),
});
@@ -158,7 +160,9 @@ const updateSchema = Joi.object({
default_value: Joi.any(),
max_length: [Joi.number(), Joi.string(), Joi.valid(null)],
is_nullable: Joi.bool(),
}).unknown(),
})
.unknown()
.allow(null),
meta: Joi.any(),
}).unknown();

View File

@@ -19,7 +19,7 @@ export function getLocalTypeForField(
if (relations.length === 1) {
const relation = relations[0];
if (relation.one_collection === 'directus_files') return 'file';
if (relation.many_collection === collection) return 'm2o';
if (relation.many_collection === collection && relation.many_field === field) return 'm2o';
return 'o2m';
}