mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
removed relation options from tree decorators too
This commit is contained in:
parent
11817adc2e
commit
ff539c4564
@ -16,7 +16,7 @@ export class Category {
|
||||
@TreeParent()
|
||||
parentCategory: Category;
|
||||
|
||||
@TreeChildren({ cascadeAll: true })
|
||||
@TreeChildren({ cascadeInsert: true, cascadeUpdate: true })
|
||||
childCategories: Category[];
|
||||
|
||||
@TreeLevelColumn()
|
||||
|
||||
@ -6,7 +6,7 @@ import {RelationMetadataArgs} from "../../metadata-args/RelationMetadataArgs";
|
||||
/**
|
||||
* Marks a specific property of the class as a children of the tree.
|
||||
*/
|
||||
export function TreeChildren(options?: RelationOptions): Function {
|
||||
export function TreeChildren(options?: { cascadeInsert?: boolean, cascadeUpdate?: boolean }): Function {
|
||||
return function (object: Object, propertyName: string) {
|
||||
if (!options) options = {} as RelationOptions;
|
||||
|
||||
|
||||
@ -6,10 +6,9 @@ import {RelationMetadataArgs} from "../../metadata-args/RelationMetadataArgs";
|
||||
/**
|
||||
* Marks a specific property of the class as a parent of the tree.
|
||||
*/
|
||||
export function TreeParent(options?: RelationOptions): Function {
|
||||
export function TreeParent(options?: { cascadeInsert?: boolean, cascadeUpdate?: boolean }): Function {
|
||||
return function (object: Object, propertyName: string) {
|
||||
if (!options) options = {} as RelationOptions;
|
||||
|
||||
const reflectedType = (Reflect as any).getMetadata("design:type", object, propertyName);
|
||||
const isLazy = reflectedType && typeof reflectedType.name === "string" && reflectedType.name.toLowerCase() === "promise";
|
||||
|
||||
|
||||
@ -382,7 +382,6 @@ export class SubjectBuilder<Entity extends ObjectLiteral> {
|
||||
if (alreadyLoadedRelatedDatabaseSubject.mustBeRemoved)
|
||||
return;
|
||||
|
||||
console.log("marked as removed: ", alreadyLoadedRelatedDatabaseSubject);
|
||||
alreadyLoadedRelatedDatabaseSubject.mustBeRemoved = true;
|
||||
await this.buildCascadeRemovedAndRelationUpdateOperateSubjects(alreadyLoadedRelatedDatabaseSubject);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user