mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
@@ -93,7 +93,7 @@ router.post(
|
||||
throw new InvalidPayloadException(error.message);
|
||||
}
|
||||
|
||||
const field: Partial<Field> & { field: string; type: typeof types[number] } = req.body;
|
||||
const field: Partial<Field> & { field: string; type: typeof types[number] | null } = req.body;
|
||||
|
||||
await service.createField(req.params.collection, field);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ data:
|
||||
- collection: directus_files
|
||||
icon: folder
|
||||
note: Metadata for all managed file assets
|
||||
display_template: '{{ title }}'
|
||||
display_template: '{{ $thumbnail }} {{ title }}'
|
||||
- collection: directus_folders
|
||||
note: Provides virtual directories for files
|
||||
display_template: '{{ name }}'
|
||||
|
||||
@@ -186,7 +186,7 @@ export class FieldsService {
|
||||
try {
|
||||
column = await this.schemaInspector.columnInfo(collection, field);
|
||||
column.default_value = getDefaultValue(column);
|
||||
} finally {
|
||||
} catch {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ export class FieldsService {
|
||||
|
||||
async createField(
|
||||
collection: string,
|
||||
field: Partial<Field> & { field: string; type: typeof types[number] },
|
||||
field: Partial<Field> & { field: string; type: typeof types[number] | null },
|
||||
table?: Knex.CreateTableBuilder // allows collection creation to
|
||||
): Promise<void> {
|
||||
if (this.accountability && this.accountability.admin !== true) {
|
||||
|
||||
Reference in New Issue
Block a user