Choose your language:
    Update a filter
    Parameters
    name  string  Optional

    The name of the filter

    filter  object  Optional

    The actual filter

    shared  boolean  Optional

    Whether it's a shared filter or not

    Returns
    Returns a upload_filter object.

    Examples

    Example code:
    const SiteClient = require('datocms-client').SiteClient;
    const client = new SiteClient('YOUR-API-TOKEN');
    const uploadFilterId = '34';
    client.uploadFilter.update(uploadFilterId, {
    name: 'Draft posts',
    shared: true,
    filter: {
    status: {
    eq: 'draft'
    }
    }
    })
    .then((uploadFilter) => {
    console.log(uploadFilter);
    })
    .catch((error) => {
    console.error(error);
    });
    Returned output:
    > node example.js
    {
    "id": "34",
    "name": "Draft posts",
    "filter": {
    "status": {
    "eq": "draft"
    }
    },
    "shared": true
    }