mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 07:50:37 +01:00
* feat: new routes for flags API + flag get + flag creation, migration from socket method + flag update, migration from socket method * fixed bug where you could not unassign someone from a flag * feat: tests for new flags API added missing files for schema update * fix: flag tests to use Write API instead of sockets * feat: flag notes API + tests * chore: remove debug line * test: fix breaking test on mongo
38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
post:
|
|
tags:
|
|
- flags
|
|
summary: create a flag
|
|
description: This operation creates a new flag (with a report). If a flag already exists for a given user or post, a report will be appended to the existing flag. The response will change depending on the privilege level of the calling uid. Privileged users (moderators and up) will see the full flag details, whereas regular users will see an empty (but successful) response.
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum: ['post', 'user']
|
|
example: 'post'
|
|
id:
|
|
type: number
|
|
example: 2
|
|
reason:
|
|
type: string
|
|
example: 'Spam'
|
|
required:
|
|
- type
|
|
- id
|
|
- reason
|
|
responses:
|
|
'200':
|
|
description: flag successfully created
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
$ref: ../components/schemas/Status.yaml#/Status
|
|
response:
|
|
$ref: ../components/schemas/FlagObject.yaml#/FlagObject |