Refactor tenant ORM integration (#1650)
* Refactor tenant ORM integration * fix tests
This commit is contained in:
@ -0,0 +1,21 @@
|
||||
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'],
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user