mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-27 17:14:55 +00:00
fix: remove access type from document
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
import { Body, Controller, Get, Param, Post, UploadedFile, UseInterceptors } from '@nestjs/common';
|
||||
import { Body, Controller, Post, UploadedFile, UseInterceptors } from '@nestjs/common';
|
||||
import { FileInterceptor } from '@nestjs/platform-express';
|
||||
import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger';
|
||||
import { memoryStorage } from 'multer';
|
||||
import { ResponseFactory } from '~/core/utils';
|
||||
import { UploadDocumentRequestDto } from '../dtos/request';
|
||||
import { DocumentMetaResponseDto } from '../dtos/response';
|
||||
import { AccessType, DocumentType } from '../enums';
|
||||
import { DocumentType } from '../enums';
|
||||
import { DocumentService } from '../services';
|
||||
@Controller('document')
|
||||
@ApiTags('document')
|
||||
@ -26,12 +26,8 @@ export class DocumentController {
|
||||
type: 'string',
|
||||
enum: Object.values(DocumentType),
|
||||
},
|
||||
accessType: {
|
||||
type: 'string',
|
||||
enum: Object.values(AccessType),
|
||||
},
|
||||
},
|
||||
required: ['document', 'documentType', 'accessType'],
|
||||
required: ['document', 'documentType'],
|
||||
},
|
||||
})
|
||||
@UseInterceptors(FileInterceptor('document', { storage: memoryStorage() }))
|
||||
@ -43,11 +39,4 @@ export class DocumentController {
|
||||
|
||||
return ResponseFactory.data(new DocumentMetaResponseDto(document));
|
||||
}
|
||||
|
||||
@Get(':documentId')
|
||||
async findDocumentById(@Param('documentId') documentId: string) {
|
||||
const document = await this.documentService.findDocumentById(documentId);
|
||||
console.log(document);
|
||||
return ResponseFactory.data(new DocumentMetaResponseDto(document));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user