mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 16:44:07 -08:00
wip: Rebase after renaming DB entity
This commit is contained in:
parent
7718cdac73
commit
9be4e50b9a
|
@ -2,26 +2,26 @@ import type { FindManyOptions, FindOptionsWhere } from '@n8n/typeorm';
|
|||
import { DataSource, In, Repository } from '@n8n/typeorm';
|
||||
import { Service } from 'typedi';
|
||||
|
||||
import { TestEntity } from '@/databases/entities/test-entity';
|
||||
import { TestDefinition } from '@/databases/entities/test-definition';
|
||||
import type { ListQuery } from '@/requests';
|
||||
|
||||
@Service()
|
||||
export class TestRepository extends Repository<TestEntity> {
|
||||
export class TestRepository extends Repository<TestDefinition> {
|
||||
constructor(dataSource: DataSource) {
|
||||
super(TestEntity, dataSource.manager);
|
||||
super(TestDefinition, dataSource.manager);
|
||||
}
|
||||
|
||||
async getMany(sharedWorkflowIds: string[], options?: ListQuery.Options) {
|
||||
if (sharedWorkflowIds.length === 0) return { tests: [], count: 0 };
|
||||
|
||||
const where: FindOptionsWhere<TestEntity> = {
|
||||
const where: FindOptionsWhere<TestDefinition> = {
|
||||
...options?.filter,
|
||||
workflow: {
|
||||
id: In(sharedWorkflowIds),
|
||||
},
|
||||
};
|
||||
|
||||
const findManyOptions: FindManyOptions<TestEntity> = {
|
||||
const findManyOptions: FindManyOptions<TestDefinition> = {
|
||||
where,
|
||||
relations: ['annotationTag'],
|
||||
order: { createdAt: 'DESC' },
|
||||
|
|
|
@ -47,7 +47,7 @@ export class TestsService {
|
|||
return await this.testRepository.getOne(id, accessibleWorkflowIds);
|
||||
}
|
||||
|
||||
async save(test: TestEntity) {
|
||||
async save(test: TestDefinition) {
|
||||
await validateEntity(test);
|
||||
|
||||
return await this.testRepository.save(test);
|
||||
|
|
Loading…
Reference in a new issue