File tree 3 files changed +121
-126
lines changed
3 files changed +121
-126
lines changed Original file line number Diff line number Diff line change 1
1
import {
2
- DeepPartial ,
3
2
EntityNotFoundError ,
4
3
FindManyOptions ,
5
4
FindOneOptions ,
@@ -182,7 +181,10 @@ export abstract class BaseRepository<Entity extends ObjectLiteral> extends Repos
182
181
/**
183
182
* Must use this method inside transaction for update multiple entities
184
183
*/
185
- async updateOrFail ( criteria : FindOptionsWhere < Entity > , partialEntity : DeepPartial < Entity > ) : Promise < UpdateResult > {
184
+ async updateOrFail (
185
+ criteria : FindOptionsWhere < Entity > ,
186
+ partialEntity : QueryDeepPartialEntity < Entity >
187
+ ) : Promise < UpdateResult > {
186
188
const recordCount = await this . count ( { where : criteria } ) ;
187
189
const queryResult = await this . update ( criteria , partialEntity ) ;
188
190
@@ -203,11 +205,4 @@ export abstract class BaseRepository<Entity extends ObjectLiteral> extends Repos
203
205
} )
204
206
) ;
205
207
}
206
-
207
- async exists ( conditions ?: FindOptionsWhere < Entity > | BaseQuery < Entity > ) {
208
- if ( conditions instanceof BaseQuery ) {
209
- return Boolean ( await this . findOne ( conditions ) ) ;
210
- }
211
- return Boolean ( await this . findOne ( { where : conditions } ) ) ;
212
- }
213
208
}
You can’t perform that action at this time.
0 commit comments