diff --git a/packages/docs/docs/api/reference.md b/packages/docs/docs/api/reference.md index f43b0c8da9..f97a6abcd8 100644 --- a/packages/docs/docs/api/reference.md +++ b/packages/docs/docs/api/reference.md @@ -59,6 +59,14 @@ import APIList from './APIList'; "mergePayees" ]} /> + + + +#### Methods + +#### `getTags` + + + +Get all tags. + +#### `createTag` + + + +Create a tag. Returns the `id` of the new tag. + +#### `updateTag` + + + +Update fields of a tag. `fields` can specify any field described in [`Tag`](#tag). + +#### `deleteTag` + + + +Delete a tag. + +#### Examples + +```js +// Create a tag +await createTag({ + tag: 'groceries', + color: '#ff0000', + description: 'Grocery shopping expenses', +}); +``` + +```js +// Get all tags +let tags = await getTags(); +``` + +```js +// Update a tag's color +await updateTag(id, { color: '#00ff00' }); +``` + ## Rules #### ConditionOrAction diff --git a/packages/docs/docs/api/types.jsx b/packages/docs/docs/api/types.jsx index 7fda7e8d81..8c64ab291c 100644 --- a/packages/docs/docs/api/types.jsx +++ b/packages/docs/docs/api/types.jsx @@ -418,6 +418,13 @@ export const objects = { }, ], + tag: [ + { name: 'id', type: types.id }, + { name: 'tag', type: 'string', required: true }, + { name: 'color', type: 'string' }, + { name: 'description', type: 'string' }, + ], + condition: [ { name: 'field', type: 'string', required: true }, { name: 'op', type: 'string', required: true },