refactor: refactored attachment entirely

This commit is contained in:
2026-07-07 11:59:05 +03:30
parent 9565eda0fd
commit eb6fbc3ce5
4 changed files with 26 additions and 34 deletions
@@ -4,7 +4,11 @@ import { AttachmentService } from '../providers/attachment.service';
import { CreateAttachmentDto } from '../dto/attachment/create-attachment.dto';
import { UpdateAttachmentDto } from '../dto/attachment/update-attachment.dto';
import { TMAttachment } from '../entities/attachment.entity';
import { AuthGuards } from '../../../common/decorators/auth-guard.decorator';
import { AdminRoute } from '../../../common/decorators/admin.decorator';
@AuthGuards()
@AdminRoute()
@ApiTags('Task Manager - Attachments')
@Controller('task-manager/attachments')
export class AttachmentController {
@@ -25,7 +29,7 @@ export class AttachmentController {
@ApiResponse({ status: 200, description: 'Attachment found', type: TMAttachment })
@ApiResponse({ status: 404, description: 'Attachment not found' })
findOne(@Param('id') id: string): Promise<TMAttachment> {
return this.attachmentService.findOne(id);
return this.attachmentService.findOneOrFail(id);
}
@Post()