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

Commit a6d7ba2

Browse files
leonardofalkpleerock
authored andcommitted
fix: add SaveOptions and RemoveOptions into ActiveRecord (typeorm#4318)
* Adding SaveOptions to BaseEntity#save * Adding RemoveOptions to BaseEntity#remove
1 parent 684ffd1 commit a6d7ba2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/repository/BaseEntity.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ export class BaseEntity {
4646
* Saves current entity in the database.
4747
* If entity does not exist in the database then inserts, otherwise updates.
4848
*/
49-
save(): Promise<this> {
50-
return (this.constructor as any).getRepository().save(this);
49+
save(options?: SaveOptions): Promise<this> {
50+
return (this.constructor as any).getRepository().save(this, options);
5151
}
5252

5353
/**
5454
* Removes current entity from the database.
5555
*/
56-
remove(): Promise<this> {
57-
return (this.constructor as any).getRepository().remove(this);
56+
remove(options?: RemoveOptions): Promise<this> {
57+
return (this.constructor as any).getRepository().remove(this, options);
5858
}
5959

6060
/**

0 commit comments

Comments
 (0)