Skip to content
Snippets Groups Projects
Commit c624c268 authored by Manjunath Kumar's avatar Manjunath Kumar
Browse files

fetch-document-by-id-review-changes-2

parent 8413cabd
No related branches found
No related tags found
1 merge request!3fetchdocumentById in dms
......@@ -11,7 +11,6 @@ import {
Body,
UploadedFile,
UseInterceptors,
NotFoundException,
} from '@nestjs/common';
import {FileInterceptor} from '@nestjs/platform-express';
import {
......@@ -21,7 +20,7 @@ import {
ApiResponse,
ApiTags,
} from '@nestjs/swagger';
import {Logger} from 'nest-common-utilities';
import {Logger ,AppException} from 'nest-common-utilities';
import {UploadDocumentRequestDto} from './dto/upload-document-request-dto';
import {DocumentService} from './document.service';
import {FetchDocumentRequestDto} from './dto/fetch-document-request.dto';
......@@ -138,7 +137,7 @@ export class DocumentController {
): Promise<FetchDocumentResponseDto> {
const result = await this.documentService.fetchDocument(body.id);
if (!result) {
throw new NotFoundException('Document not found');
throw new AppException('404', 'Document not found');
}
// Optionally, map result to FetchDocumentResponseDto if needed
return result as FetchDocumentResponseDto;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment