Sorry, no results found for "".
Must be exactly "item_type_filter"
.
The name of the filter
"Draft posts"
The columns to show with this filter
[
{ name: "_preview", width: 0.6 },
{ name: "slug", width: 0.1 },
{ name: "_status", width: 0.1 },
{ name: "_updated_at", width: 0.2 },
]
Can be either the API key of a model's field, or one of the following meta columns: id
, _preview
, _updated_at
, _created_at
, _creator
, _status
, _published_at
, _first_published_at
, _publication_scheduled_at
, _unpublishing_scheduled_at
, position
(only for sortable models), `_stage (only for models associated with a workflow).
The percentage width for the column (float, from 0 to 1.0)
The ordering to apply with this filter, or null
for the default model ordering. It follows the form of the order_by
query parameter of the List all records endpoint.
"_updated_at_ASC"
Whether it's a shared filter or not
The actual filter. It follows the form of the filter
query parameter of the List all records endpoint.
{
query: "foo bar",
fields: {
_status: { eq: "draft" },
title: {
matches: { pattern: "qux", case_sensitive: "false", regexp: "false" },
},
},
}
Model associated with the filter
Returns a resource object of type item_type_filter.
PUT https://site-api.datocms.com/item-type-filters/:item_type_filter_id HTTP/1.1Authorization: Bearer YOUR-API-TOKENAccept: application/jsonX-Api-Version: 3Content-Type: application/vnd.api+json
{ "data": { "type": "item_type_filter", "id": "FF-P5of6Qp-DD2w0xoaa6Q", "attributes": {} }}
curl -g 'https://site-api.datocms.com/item-type-filters/:item_type_filter_id' \ -X PUT \ -H "Authorization: Bearer YOUR-API-TOKEN" \ -H "Accept: application/json" \ -H "X-Api-Version: 3" \ -H "Content-Type: application/vnd.api+json" \ --data-binary '{"data":{"type":"item_type_filter","id":"FF-P5of6Qp-DD2w0xoaa6Q","attributes":{}}}'
await fetch( "https://site-api.datocms.com/item-type-filters/:item_type_filter_id", { method: "PUT", headers: { Authorization: "Bearer YOUR-API-TOKEN", Accept: "application/json", "X-Api-Version": "3", "Content-Type": "application/vnd.api+json", }, body: JSON.stringify({ data: { type: "item_type_filter", id: "FF-P5of6Qp-DD2w0xoaa6Q", attributes: {}, }, }), },);
HTTP/1.1 200 OKContent-Type: application/jsonCache-Control: cache-control: max-age=0, private, must-revalidateX-RateLimit-Limit: 30X-RateLimit-Remaining: 28
{ "data": { "type": "item_type_filter", "id": "FF-P5of6Qp-DD2w0xoaa6Q", "relationships": { "item_type": { "data": { "type": "item_type", "id": "DxMaW10UQiCmZcuuA-IkkA" } } }, "attributes": { "name": "Draft posts", "filter": { "query": "foo bar", "fields": { "_status": { "eq": "draft" }, "title": { "matches": { "pattern": "qux", "case_sensitive": "false", "regexp": "false" } } } }, "columns": [ { "name": "_preview", "width": 0.6 }, { "name": "slug", "width": 0.1 }, { "name": "_status", "width": 0.1 }, { "name": "_updated_at", "width": 0.2 } ], "order_by": "_updated_at_ASC", "shared": true } }}