mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Process field / collection info
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import database, { schemaInspector } from '../database';
|
||||
import { Query } from '../types/query';
|
||||
import database from '../database';
|
||||
import { AbstractServiceOptions, Accountability, Collection } from '../types';
|
||||
import Knex from 'knex';
|
||||
import ItemsService from '../services/items';
|
||||
|
||||
@@ -99,12 +99,14 @@ export default class FieldsService {
|
||||
/** @todo add accountability */
|
||||
async readOne(collection: string, field: string) {
|
||||
let column;
|
||||
const fieldInfo = await this.knex
|
||||
let fieldInfo = await this.knex
|
||||
.select('*')
|
||||
.from('directus_fields')
|
||||
.where({ collection, field })
|
||||
.first();
|
||||
|
||||
fieldInfo = (await this.payloadService.processValues('read', fieldInfo)) as System[];
|
||||
|
||||
try {
|
||||
column = await schemaInspector.columnInfo(collection, field);
|
||||
} catch {}
|
||||
|
||||
Reference in New Issue
Block a user