mirror of
https://github.com/directus/directus.git
synced 2026-04-03 03:00:39 -04:00
Various m2a builder fixes (#4032)
* Fix drawer opening empty item after sort * Fix null sorting * Fix sending null for a type in field creation * Fix sort / edit existing on sorted values in m2a builder Fixes #4005, fixes #4007 * Remove stray console log
This commit is contained in:
@@ -66,7 +66,8 @@ const newFieldSchema = Joi.object({
|
||||
collection: Joi.string().optional(),
|
||||
field: Joi.string().required(),
|
||||
type: Joi.string()
|
||||
.valid(...types, null)
|
||||
.valid(...types)
|
||||
.allow(null)
|
||||
.required(),
|
||||
schema: Joi.object({
|
||||
default_value: Joi.any(),
|
||||
@@ -150,7 +151,7 @@ router.patch(
|
||||
|
||||
const updateSchema = Joi.object({
|
||||
type: Joi.string()
|
||||
.valid(...types, null)
|
||||
.valid(...types)
|
||||
.required(),
|
||||
schema: Joi.object({
|
||||
default_value: Joi.any(),
|
||||
|
||||
@@ -203,7 +203,7 @@ export class FieldsService {
|
||||
throw new InvalidPayloadException(`Field "${field.field}" already exists in collection "${collection}"`);
|
||||
}
|
||||
|
||||
if (ALIAS_TYPES.includes(field.type) === false) {
|
||||
if (field.type && ALIAS_TYPES.includes(field.type) === false) {
|
||||
if (table) {
|
||||
this.addColumnToTable(table, field as Field);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user