templates: support include_total for search and categories endpoints; update docs; add tests

This commit is contained in:
HotSwapp
2025-08-15 15:06:45 -05:00
parent e3a279dba7
commit 006ef3d7b1
3 changed files with 43 additions and 6 deletions

View File

@@ -302,6 +302,7 @@ Allowed sort fields (high level):
- `sort_by` (str, optional): `name` (default) | `category` | `updated`
- `sort_dir` (str, optional): `asc` (default) | `desc`
- `active_only` (bool, optional): when `true` (default), only active templates are returned
- `include_total` (bool, optional): when `true`, returns `{ items, total }` instead of a plain list
- Examples:
```bash
# Any of the keywords (default)
@@ -320,6 +321,7 @@ Allowed sort fields (high level):
- `GET /api/templates/categories` - List distinct template categories with counts
- Query params:
- `active_only` (bool, optional): when `true` (default), only counts active templates
- `include_total` (bool, optional): when `true`, returns `{ items, total }` instead of a plain list
- Example:
```bash
curl "http://localhost:6920/api/templates/categories?active_only=false"