#Hi, is it possible to share a block (cta) to different collection (pages and posts)?Got this error:

1 messages · Page 1 of 1 (latest)

brisk anvil
#

insert or update on table "block_cta" violates foreign key constraint "block_cta_parent_id_fk"

dawn apexBOT
pearl crane
#

Hey I have a similar issue did you find a solution ?

brisk anvil
#

Hi, I don't have better solution yet, I did this for a temporary solution:

import { Cta } from '@/blocks/Cta/config' const CtaBlock = JSON.parse(JSON.stringify(Cta)); CtaBlock.dbName = 'posts_cta'; ... { name: 'layout', label: 'Layout', labels: { singular: 'Layout', plural: 'Layouts', }, type: 'blocks', unique: true, blocks: [ CtaBlock, MediaBlock, Archive, FormBlock ], required: false, } ...