Skip the deletion of the menu items linked to the model
import { buildClient } from '@datocms/cma-client-node';async function run() {const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });const modelIdOrApiKey = 'blog_post';const itemType = await client.itemTypes.destroy(modelIdOrApiKey, {skip_menu_items_deletion: true});console.log(itemType);}run();
{id: '44',name: 'Blog post',api_key: 'post',collection_appearance: 'compact',singleton: false,all_locales_required: false,sortable: true,modular_block: false,draft_mode_active: false,tree: false,ordering_direction: null,ordering_meta: 'created_at',hint: 'Blog posts will be shown in our website under the Blog section',inverse_relationships_enabled: false,meta: {has_singleton_item: false},singleton_item: null,fields: [{type: 'field',id: '124'}],fieldsets: [{type: 'fieldset',id: '124'}],title_field: null,image_preview_field: null,excerpt_field: null,ordering_field: null,workflow: null}