Skip to content

Commit

Permalink
fix: document 없을 때 404 뱉지 않게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
juyeong-s committed Jun 16, 2024
1 parent b5f25d6 commit 82c1344
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/common/mongo.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ export abstract class BaseRepository<TDocument extends BaseSchema> {

async findOne(filterQuery: FilterQuery<TDocument>) {
const document = await this.model.findOne(filterQuery, {}, { lean: true });

if (!document) {
this.logger.warn('Document not found with filterQuery', filterQuery);
throw new NotFoundException('Document not found.');
}
return document;
}

Expand All @@ -52,12 +47,6 @@ export abstract class BaseRepository<TDocument extends BaseSchema> {
lean: true,
new: true,
});

if (!document) {
this.logger.warn(`Document not found with filterQuery:`, filterQuery);
throw new NotFoundException('Document not found.');
}

return document;
}

Expand Down

0 comments on commit 82c1344

Please sign in to comment.