chore: add is pinned to the blog entity and also add route for it
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user