👷 Transpile components for better DX
This commit is contained in:
committed by
Baptiste Arnaud
parent
898367a33b
commit
c1dd4d403e
@ -138,16 +138,26 @@ const duplicateBlockDraft =
|
||||
(groupId: string) =>
|
||||
(block: Block): Block => {
|
||||
const blockId = cuid()
|
||||
if (blockHasItems(block))
|
||||
return {
|
||||
...block,
|
||||
groupId,
|
||||
id: blockId,
|
||||
items: block.items.map(duplicateItemDraft(blockId)),
|
||||
outgoingEdgeId: undefined,
|
||||
} as Block
|
||||
if (isWebhookBlock(block))
|
||||
return {
|
||||
...block,
|
||||
groupId,
|
||||
id: blockId,
|
||||
webhookId: cuid(),
|
||||
outgoingEdgeId: undefined,
|
||||
}
|
||||
return {
|
||||
...block,
|
||||
groupId,
|
||||
id: blockId,
|
||||
items: blockHasItems(block)
|
||||
? block.items.map(duplicateItemDraft(blockId))
|
||||
: undefined,
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
//@ts-ignore
|
||||
webhookId: isWebhookBlock(block) ? cuid() : undefined,
|
||||
outgoingEdgeId: undefined,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user