aboutsummaryrefslogtreecommitdiff
path: root/API.md
diff options
context:
space:
mode:
authorrr-2016-05-22 18:49:38 +0200
committerrr-2016-05-22 22:17:11 +0200
commit77998f1660e91350753bc4106559ea211a480c84 (patch)
tree3ab80ddc6a37546ee45b3d6ced44e3feb62f7b86 /API.md
parent4b3640bf2ebbc7f7c9a8a40ea0543d4f08194202 (diff)
server/tags: let mods set default category
Diffstat (limited to 'API.md')
-rw-r--r--API.md34
1 files changed, 32 insertions, 2 deletions
diff --git a/API.md b/API.md
index 5a2c629..40898d6 100644
--- a/API.md
+++ b/API.md
@@ -19,6 +19,7 @@
- [Updating tag category](#updating-tag-category)
- [Getting tag category](#getting-tag-category)
- [Deleting tag category](#deleting-tag-category)
+ - [Setting default tag category](#setting-default-tag-category)
- Tags
- [Listing tags](#listing-tags)
- [Creating tag](#creating-tag)
@@ -185,7 +186,8 @@ data.
- **Description**
Creates a new tag category using specified parameters. Name must match
- `tag_category_name_regex` from server's configuration.
+ `tag_category_name_regex` from server's configuration. First category
+ created becomes the default category.
## Updating tag category
- **Request**
@@ -260,6 +262,31 @@ data.
Deletes existing tag category. The tag category to be deleted must have no
usages.
+## Setting default tag category
+- **Request**
+
+ `PUT /tag-category/<name>/default`
+
+- **Input**
+
+ ```json5
+ {}
+ ```
+
+- **Output**
+
+ A [detailed tag category resource](#detailed-tag-category).
+
+- **Errors**
+
+ - the tag category does not exist
+ - privileges are too low
+
+- **Description**
+
+ Sets given tag category as default. All new tags created manually or
+ automatically will have this category.
+
## Listing tags
- **Request**
@@ -1405,6 +1432,7 @@ experience.
"name": <name>,
"color": <color>,
"usages": <usages>
+ "default": <is_default>
}
```
@@ -1413,6 +1441,7 @@ experience.
- `<name>`: the category name.
- `<color>`: the category color.
- `<usages>`: how many tags is the given category used with.
+- `<is_default>`: whether the tag category is the default one.
## Detailed tag category
**Description**
@@ -1723,7 +1752,8 @@ A snapshot is a version of a database resource.
```json5
{
"name": "character",
- "color": "#FF0000"
+ "color": "#FF0000",
+ "default": false
}
```

© 2015 - 2026 Jakob L. Kreuze