Expose JWT-protected /blog-posts endpoints for draft creation, listing, update, and delete.
22 lines
427 B
TypeScript
22 lines
427 B
TypeScript
import { IsBoolean, IsNotEmpty, IsString, MaxLength } from 'class-validator';
|
|
|
|
import { getAppConfig } from '../../../config';
|
|
|
|
const {
|
|
validation: { blogPostTitleMaxLength }
|
|
} = getAppConfig();
|
|
|
|
export class UpdateBlogPostDto {
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
@MaxLength(blogPostTitleMaxLength)
|
|
title: string;
|
|
|
|
@IsString()
|
|
contentHtml: string;
|
|
|
|
@IsNotEmpty()
|
|
@IsBoolean()
|
|
isDraft: boolean;
|
|
}
|