mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-02 13:50:36 +01:00
Post queue write api (#13473)
* move post queue from socket.io to rest api * move harmony post-queue to core add canEdit, allow users to edit their queued posts * fix: openapi spec * lint: whitespace
This commit is contained in:
92
public/openapi/write/posts/queue/id.yaml
Normal file
92
public/openapi/write/posts/queue/id.yaml
Normal file
@@ -0,0 +1,92 @@
|
||||
post:
|
||||
summary: Accept a queued post
|
||||
tags:
|
||||
- QueuedPosts
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
description: a valid queued post id
|
||||
example: 2
|
||||
responses:
|
||||
'200':
|
||||
description: post successfully accepted
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
type: object
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
pid:
|
||||
type: number
|
||||
tid:
|
||||
type: number
|
||||
'400':
|
||||
description: Bad request, invalid post id
|
||||
delete:
|
||||
summary: Remove a queued post
|
||||
tags:
|
||||
- QueuedPosts
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
example: 'topic-12345'
|
||||
responses:
|
||||
'200':
|
||||
description: Post removed successfully
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
type: object
|
||||
'400':
|
||||
description: Bad request, invalid post id
|
||||
put:
|
||||
summary: Edit a queued post
|
||||
tags:
|
||||
- QueuedPosts
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
example: 'topic-12345'
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: string
|
||||
example: This is a test reply
|
||||
cid:
|
||||
type: number
|
||||
description: Category ID to which the post belongs
|
||||
title:
|
||||
type: string
|
||||
description: Updated Post Title
|
||||
responses:
|
||||
'200':
|
||||
description: Post edited successfully
|
||||
'400':
|
||||
description: Bad request, invalid post id
|
||||
|
||||
|
||||
36
public/openapi/write/posts/queue/notify.yaml
Normal file
36
public/openapi/write/posts/queue/notify.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
post:
|
||||
summary: Notify the owner of a queued post
|
||||
tags:
|
||||
- QueuedPosts
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
description: a valid queued post id
|
||||
example: 2
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
example: body of the notification message
|
||||
responses:
|
||||
'200':
|
||||
description: post successfully accepted
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
type: object
|
||||
'400':
|
||||
description: Bad request, invalid post id
|
||||
Reference in New Issue
Block a user