From a6d7ba27efffd88acbe43096f5259f0d3b16498b Mon Sep 17 00:00:00 2001 From: Leonardo Falk Date: Sun, 30 Jun 2019 12:07:19 -0300 Subject: [PATCH] fix: add SaveOptions and RemoveOptions into ActiveRecord (#4318) * Adding SaveOptions to BaseEntity#save * Adding RemoveOptions to BaseEntity#remove --- src/repository/BaseEntity.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/repository/BaseEntity.ts b/src/repository/BaseEntity.ts index 78f24d291a..37d9694a74 100644 --- a/src/repository/BaseEntity.ts +++ b/src/repository/BaseEntity.ts @@ -46,15 +46,15 @@ export class BaseEntity { * Saves current entity in the database. * If entity does not exist in the database then inserts, otherwise updates. */ - save(): Promise { - return (this.constructor as any).getRepository().save(this); + save(options?: SaveOptions): Promise { + return (this.constructor as any).getRepository().save(this, options); } /** * Removes current entity from the database. */ - remove(): Promise { - return (this.constructor as any).getRepository().remove(this); + remove(options?: RemoveOptions): Promise { + return (this.constructor as any).getRepository().remove(this, options); } /**