From 2a6b589edb7a84402bf7bc7af994d5846c2ed548 Mon Sep 17 00:00:00 2001 From: Olasunkanmi Oyinlola Date: Sun, 21 Jan 2024 16:45:28 +0800 Subject: [PATCH] fix build error --- .../database/mongoDB/generic-document.repository.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/infrastructure/database/mongoDB/generic-document.repository.ts b/backend/src/infrastructure/database/mongoDB/generic-document.repository.ts index 0c914317..06e4d7f5 100644 --- a/backend/src/infrastructure/database/mongoDB/generic-document.repository.ts +++ b/backend/src/infrastructure/database/mongoDB/generic-document.repository.ts @@ -113,7 +113,7 @@ export abstract class GenericDocumentRepository 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); @@ -134,7 +134,7 @@ export abstract class GenericDocumentRepository 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 });