Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Commit

Permalink
fix: add SaveOptions and RemoveOptions into ActiveRecord (typeorm#4318)
Browse files Browse the repository at this point in the history
* Adding SaveOptions to BaseEntity#save

* Adding RemoveOptions to BaseEntity#remove
  • Loading branch information
leonardofalk authored and pleerock committed Jun 30, 2019
1 parent 684ffd1 commit a6d7ba2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/repository/BaseEntity.ts
Expand Up @@ -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<this> {
return (this.constructor as any).getRepository().save(this);
save(options?: SaveOptions): Promise<this> {
return (this.constructor as any).getRepository().save(this, options);
}

/**
* Removes current entity from the database.
*/
remove(): Promise<this> {
return (this.constructor as any).getRepository().remove(this);
remove(options?: RemoveOptions): Promise<this> {
return (this.constructor as any).getRepository().remove(this, options);
}

/**
Expand Down

0 comments on commit a6d7ba2

Please sign in to comment.