chore: add is pinned to the blog entity and also add route for it

This commit is contained in:
mahyargdz
2025-04-12 16:28:02 +03:30
parent 39cce1c380
commit d76b9326e6
6 changed files with 53 additions and 2 deletions
+10 -2
View File
@@ -1,5 +1,5 @@
import { ApiProperty } from "@nestjs/swagger";
import { ArrayMinSize, IsArray, IsBoolean, IsNotEmpty, IsString, IsUUID, MaxLength } from "class-validator";
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { ArrayMinSize, IsArray, IsBoolean, IsNotEmpty, IsOptional, IsString, IsUUID, MaxLength } from "class-validator";
import { BlogMessage } from "../../../common/enums/message.enum";
@@ -55,4 +55,12 @@ export class CreateBlogDto {
@IsBoolean({ message: BlogMessage.IS_ACTIVE_SHOULD_BE_A_BOOLEAN })
@ApiProperty({ description: "Is active of the blog", example: true })
isActive: boolean;
@ApiPropertyOptional({
description: "Whether the blog is pinned or not",
default: false,
})
@IsOptional()
@IsBoolean({ message: BlogMessage.IS_PINNED_SHOULD_BE_A_BOOLEAN })
isPinned?: boolean;
}