Skip to content

Commit

Permalink
relations & extraQuery support
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilfronczak committed Dec 8, 2022
1 parent 5631bf9 commit 234b2a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mikroorm-nested-set",
"version": "1.0.9",
"version": "1.1.0",
"types": "src/index.d.ts",
"description": "Package for MikroORM nested set feature",
"main": "src/index.js",
Expand Down
12 changes: 1 addition & 11 deletions src/repository/nested-set-subject.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@ export abstract class NestedSetSubjectRepository<T extends NestedSetSubjectAbstr
this.nestedSetNodeOperator = new NestedSetNodeOperator<T>()
}

async findReadableTreeWithDepth(depth: number) : Promise<NestedSetSubjectAbstract<Readonly<T>>> {
return this.findAndBuildReadableTree({
depth: depth
})
}

async findReadableTree() : Promise<NestedSetSubjectAbstract<Readonly<T>>> {
return this.findAndBuildReadableTree({})
}

async persistAndFlushTree(subject: NestedSetSubjectAbstract<T>) : Promise<void> {
this.nestedSetNodeOperator.recomputeTree(subject)
return this.persistAndFlush(subject)
Expand All @@ -33,7 +23,7 @@ export abstract class NestedSetSubjectRepository<T extends NestedSetSubjectAbstr
return await this.findOne({ parent: null } as unknown as NonNullable<Query<T>>)
}

protected async findAndBuildReadableTree(options: {
async findReadableTree(options: {
extraQuery?: Record<string, any>
depth? : number,
relations?: {
Expand Down

0 comments on commit 234b2a6

Please sign in to comment.