Show examples in:
    Update a filter

    Parameters

    name  string  Required

    The name of the filter

    filter  object  Required

    The actual filter

    shared  boolean  Optional

    Whether it's a shared filter or not

    Returns

    Returns a item_type_filter resource object.

    Examples

    Example code:
    import { buildClient } from '@datocms/cma-client-node';
    async function run() {
    const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
    const itemTypeFilterId = '34';
    const itemTypeFilter = await client.itemTypeFilters.update(itemTypeFilterId, {
    name: 'Draft posts',
    shared: true,
    filter: {
    status: {
    eq: 'draft'
    }
    }
    });
    console.log(itemTypeFilter);
    }
    run();
    Returned output:
    {
    id: '34',
    name: 'Draft posts',
    filter: {
    status: {
    eq: 'draft'
    }
    },
    shared: true,
    item_type: {
    type: 'item_type',
    id: '44'
    }
    }