feat: add object/field create/update resolvers (#1963)
* feat: add object/field create/update resolvers * fix tests
This commit is contained in:
@ -1,28 +0,0 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
import { ObjectMetadata } from './object-metadata.entity';
|
||||
|
||||
@Injectable()
|
||||
export class ObjectMetadataService {
|
||||
constructor(
|
||||
@InjectRepository(ObjectMetadata, 'metadata')
|
||||
private readonly fieldMetadataRepository: Repository<ObjectMetadata>,
|
||||
) {}
|
||||
|
||||
public async getObjectMetadataFromDataSourceId(dataSourceId: string) {
|
||||
return this.fieldMetadataRepository.find({
|
||||
where: { dataSourceId },
|
||||
relations: ['fields'],
|
||||
});
|
||||
}
|
||||
|
||||
public async getObjectMetadataFromId(objectMetadataId: string) {
|
||||
return this.fieldMetadataRepository.findOne({
|
||||
where: { id: objectMetadataId },
|
||||
relations: ['fields'],
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user