|
@@ -25,11 +25,11 @@ All sub-routes require admin privileges
|
|
|
### /
|
|
|
* Method: `POST`
|
|
|
* Data params:
|
|
|
- * message \<string>
|
|
|
- * username: \<string>
|
|
|
- * canCreateThreads \<boolean>
|
|
|
- * canCreatePosts \<boolean>
|
|
|
- * ipBanned \<boolean>
|
|
|
+ * `message <string>`
|
|
|
+ * `username <string>`
|
|
|
+ * `canCreateThreads <boolean>`
|
|
|
+ * `canCreatePosts <boolean>`
|
|
|
+ * `ipBanned <boolean>`
|
|
|
* Response:
|
|
|
```
|
|
|
{
|
|
@@ -39,11 +39,11 @@ All sub-routes require admin privileges
|
|
|
canCreatePosts: <boolean>,
|
|
|
ipBanned: <boolean>,
|
|
|
User: {
|
|
|
- id: <integer>,
|
|
|
- username: <string>,
|
|
|
- description: <null | string>,
|
|
|
- color: <string>,
|
|
|
- createdAt: <string>
|
|
|
+ id: <integer>,
|
|
|
+ username: <string>,
|
|
|
+ description: <null | string>,
|
|
|
+ color: <string>,
|
|
|
+ createdAt: <string>
|
|
|
}
|
|
|
```
|
|
|
|
|
@@ -65,8 +65,97 @@ All sub-routes require admin privileges
|
|
|
|
|
|
### /:id
|
|
|
* Method: `DELETE`
|
|
|
- * URL params: id \<integer>
|
|
|
+ * URL params: `id <integer>`
|
|
|
* Response:
|
|
|
```
|
|
|
{ success: true }
|
|
|
```
|
|
|
+
|
|
|
+### /category
|
|
|
+
|
|
|
+### /
|
|
|
+ * Method: `GET`
|
|
|
+ * Reponse:
|
|
|
+ ```
|
|
|
+ [{
|
|
|
+ color: <string>,
|
|
|
+ createdAt: <string>,
|
|
|
+ id: <integer>,
|
|
|
+ name: <string>,
|
|
|
+ updatedAt: <string>,
|
|
|
+ value: <string>
|
|
|
+ }, ...]
|
|
|
+ ```
|
|
|
+
|
|
|
+### /:category
|
|
|
+ * Method: `GET`
|
|
|
+ * URL params: `category <string>`
|
|
|
+ * Query params:
|
|
|
+ * `username <string, optional>`
|
|
|
+ * `from <integer, optional>`
|
|
|
+ * `limit <integer, optional>`
|
|
|
+* Response:
|
|
|
+ ```
|
|
|
+ {
|
|
|
+ name: <string>,
|
|
|
+ value: <string>,
|
|
|
+ color: <string>,
|
|
|
+ [id: <integer>],
|
|
|
+ [createdAt: <string>],
|
|
|
+ [updatedAt: <string>],
|
|
|
+ Threads: [ ... ],
|
|
|
+ meta: {
|
|
|
+ nextURL: <string | null>,
|
|
|
+ nextThreadsCount: <integer>
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ```
|
|
|
+
|
|
|
+### /
|
|
|
+* Method: `POST`
|
|
|
+* Data params:
|
|
|
+ * `name <string>`
|
|
|
+ * `color <string, optional>`
|
|
|
+* Response:
|
|
|
+ ```
|
|
|
+ {
|
|
|
+ color: <string>,
|
|
|
+ createdAt: <string>,
|
|
|
+ id: <integer>,
|
|
|
+ name: <string>,
|
|
|
+ updatedAt: <string>,
|
|
|
+ value: <string>
|
|
|
+ }
|
|
|
+ ```
|
|
|
+* Notes: requires admin privileges
|
|
|
+
|
|
|
+### /:id
|
|
|
+* Method: `PUT`
|
|
|
+* URL params: `id <integer>`
|
|
|
+* Data params:
|
|
|
+ * `name <string, optional>`
|
|
|
+ * `color <string, optional>`
|
|
|
+* Response:
|
|
|
+ ```
|
|
|
+ {
|
|
|
+ color: <string>,
|
|
|
+ createdAt: <string>,
|
|
|
+ id: <integer>,
|
|
|
+ name: <string>,
|
|
|
+ updatedAt: <string>,
|
|
|
+ value: <string>
|
|
|
+ }
|
|
|
+ ```
|
|
|
+* Notes: requires admin privileges
|
|
|
+
|
|
|
+### /
|
|
|
+* Method: `DELETE`
|
|
|
+* URL params: `id <integer>`
|
|
|
+* Response:
|
|
|
+ ```
|
|
|
+ {
|
|
|
+ success: true,
|
|
|
+ otherCategoryCreated: <category object | null>
|
|
|
+ }
|
|
|
+ ```
|
|
|
+* Notes: requires admin privileges
|