From d169bdbe92ed0bf7eb1a2702648b32330b03be75 Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Thu, 3 Oct 2024 17:22:38 +0100 Subject: [PATCH] fix(api): apply feedback updates --- api/src/cms/dto/content.dto.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/api/src/cms/dto/content.dto.ts b/api/src/cms/dto/content.dto.ts index 69c6d4d..be795f1 100644 --- a/api/src/cms/dto/content.dto.ts +++ b/api/src/cms/dto/content.dto.ts @@ -6,7 +6,7 @@ * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file). */ -import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; +import { ApiProperty, ApiPropertyOptional, PartialType } from '@nestjs/swagger'; import { IsString, IsBoolean, IsNotEmpty, IsOptional } from 'class-validator'; import { IsObjectId } from '@/utils/validation-rules/is-object-id'; @@ -33,18 +33,4 @@ export class ContentCreateDto { dynamicFields?: Record; } -export class ContentUpdateDto { - @ApiPropertyOptional({ description: 'Content title', type: String }) - @IsString() - @IsOptional() - title?: string; - - @ApiPropertyOptional({ description: 'Content status', type: Boolean }) - @IsBoolean() - @IsOptional() - status?: boolean; - - @ApiPropertyOptional({ description: 'Content dynamic fields', type: Object }) - @IsOptional() - dynamicFields?: Record; -} +export class ContentUpdateDto extends PartialType(ContentCreateDto) {}