diff --git a/src/notion/publish/v2/createMultiValueStatListItemBlock.ts b/src/notion/publish/v2/createMultiValueStatListItemBlock.ts index 4029131..32eacb7 100644 --- a/src/notion/publish/v2/createMultiValueStatListItemBlock.ts +++ b/src/notion/publish/v2/createMultiValueStatListItemBlock.ts @@ -1,15 +1,21 @@ +import { BlockObjectRequest } from "@notionhq/client/build/src/api-endpoints"; import { ValueFormatOptions } from "../../../format/ValueFormatOptions"; import { MultiValueStatDesc } from "../../../statistiques/v2/desc/StatsDesc"; import { BulletedListItemBlockObjectRequest } from "../blocks/BulletedListItemBlockObjectRequest"; import { BulletedListItemChildren } from "../blocks/BulletedListItemChildren"; import { createSingleValueStatListItemBlock } from "./createSingleValueStatListItemBlock"; +export type ToggleBlockObjectRequest = Extract< + BlockObjectRequest, + { toggle: object } +>; + export function createMultiValueStatListItemBlock( descriptor: MultiValueStatDesc, statValue: Record -): BulletedListItemBlockObjectRequest { +): ToggleBlockObjectRequest { return { - bulleted_list_item: { + toggle: { rich_text: [ { text: { diff --git a/src/notion/publish/v2/createStatGroupListItemBlock.ts b/src/notion/publish/v2/createStatGroupListItemBlock.ts index ac3a390..89a6322 100644 --- a/src/notion/publish/v2/createStatGroupListItemBlock.ts +++ b/src/notion/publish/v2/createStatGroupListItemBlock.ts @@ -10,6 +10,7 @@ import { BulletedListItemBlockObjectRequest } from "../blocks/BulletedListItemBl import { BulletedListItemChildren } from "../blocks/BulletedListItemChildren"; import { createMultiValueStatListItemBlock } from "./createMultiValueStatListItemBlock"; import { ValueFormatOptions } from "../../../format/ValueFormatOptions"; +import { BlockObjectRequest } from "@notionhq/client/build/src/api-endpoints"; export function createStatGroupListItemBlock( descriptor: D, @@ -35,7 +36,7 @@ export function createStatGroupListItemBlock( export function createStatGroupChildrenListItemBlock( descriptor: D, stats: StatsType -): BulletedListItemBlockObjectRequest[] { +): BlockObjectRequest[] { return Object.keys(descriptor.stats).map((statName) => { const childStatDesc = descriptor.stats[statName]; const childStatValue = stats[statName];