mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
fix fields not updateable because type is null (#4061)
This commit is contained in:
@@ -7,6 +7,7 @@ import Joi from 'joi';
|
||||
import { types, Field } from '../types';
|
||||
import useCollection from '../middleware/use-collection';
|
||||
import { respond } from '../middleware/respond';
|
||||
import { ALIAS_TYPES } from '../constants';
|
||||
|
||||
const router = Router();
|
||||
|
||||
@@ -66,7 +67,7 @@ const newFieldSchema = Joi.object({
|
||||
collection: Joi.string().optional(),
|
||||
field: Joi.string().required(),
|
||||
type: Joi.string()
|
||||
.valid(...types)
|
||||
.valid(...types, ...ALIAS_TYPES)
|
||||
.allow(null)
|
||||
.required(),
|
||||
schema: Joi.object({
|
||||
@@ -150,7 +151,9 @@ router.patch(
|
||||
);
|
||||
|
||||
const updateSchema = Joi.object({
|
||||
type: Joi.string().valid(...types),
|
||||
type: Joi.string()
|
||||
.valid(...types, ...ALIAS_TYPES)
|
||||
.allow(null),
|
||||
schema: Joi.object({
|
||||
default_value: Joi.any(),
|
||||
max_length: [Joi.number(), Joi.string(), Joi.valid(null)],
|
||||
|
||||
Reference in New Issue
Block a user