Add default display template for directus_files

Fixes #5364
This commit is contained in:
rijkvanzanten
2021-04-29 20:40:52 -04:00
parent cd565c2e60
commit 74861e6f81
3 changed files with 4 additions and 4 deletions

View File

@@ -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);

View File

@@ -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 }}'

View File

@@ -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) {