Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
Olasunkanmi Oyinlola authored and Olasunkanmi Oyinlola committed Jan 21, 2024
1 parent a4167c1 commit 2a6b589
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export abstract class GenericDocumentRepository<TEntity, T extends Document> imp
const queryOptions: any = {
new: true,
};
if (options.session) {
if (options?.session) {
queryOptions.session = options.session;
}
const result = await this.DocumentModel.findByIdAndUpdate(filterQuery, update, queryOptions);
Expand All @@ -134,7 +134,7 @@ export abstract class GenericDocumentRepository<TEntity, T extends Document> imp
upsert: true,
new: true,
};
if (options.session) {
if (options?.session) {
queryOption.session = options.session;
}
const result = await this.DocumentModel.findOneAndUpdate(filterQuery, document, { session: options.session });
Expand Down

0 comments on commit 2a6b589

Please sign in to comment.