Skip to content

Commit

Permalink
Docs: Use @IsUndefinable() in BlockInput (#3169)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesricky authored Jan 16, 2025
1 parent 6b4866a commit 80a6c80
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/docs/2-core-concepts/2-blocks/1-your-first-block.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Once we have defined the block data, we also need to define the block input. The
import { inputToData } from "@comet/blocks-api";

class HeadlineBlockInput extends BlockInput {
@IsOptional()
@IsUndefinable()
@IsString()
@BlockField({ nullable: true })
eyebrow?: string;
Expand Down Expand Up @@ -127,7 +127,8 @@ The complete code for our Headline API block (including all necessary imports) c
inputToData,
} from "@comet/blocks-api";
import { RichTextBlock } from "@src/common/blocks/rich-text.block";
import { IsEnum, IsOptional, IsString } from "class-validator";\n
import { IsUndefinable } from "@comet/cms-api";
import { IsEnum, IsString } from "class-validator";\n
export enum HeadlineLevel {
HeaderOne = "header-one",
HeaderTwo = "header-two",
Expand All @@ -145,7 +146,7 @@ export class HeadlineBlockData extends BlockData {
level: HeadlineLevel;
}\n
export class HeadlineBlockInput extends BlockInput {
@IsOptional()
@IsUndefinable()
@IsString()
@BlockField()
eyebrow?: string;\n
Expand Down

0 comments on commit 80a6c80

Please sign in to comment.