Skip to content

Commit 0832e65

Browse files
Merge pull request #8 from hodfords-solutions/release/10.0.2
release: version 10.0.2
2 parents 7de32dc + a3d21ea commit 0832e65

File tree

3 files changed

+121
-126
lines changed

3 files changed

+121
-126
lines changed

libs/repositories/base.repository.ts

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
DeepPartial,
32
EntityNotFoundError,
43
FindManyOptions,
54
FindOneOptions,
@@ -182,7 +181,10 @@ export abstract class BaseRepository<Entity extends ObjectLiteral> extends Repos
182181
/**
183182
* Must use this method inside transaction for update multiple entities
184183
*/
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> {
186188
const recordCount = await this.count({ where: criteria });
187189
const queryResult = await this.update(criteria, partialEntity);
188190

@@ -203,11 +205,4 @@ export abstract class BaseRepository<Entity extends ObjectLiteral> extends Repos
203205
})
204206
);
205207
}
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-
}
213208
}

0 commit comments

Comments
 (0)