add: community topic endpoints
This commit is contained in:
parent
12fa80c7c0
commit
ef029c59b3
7 changed files with 201 additions and 28 deletions
|
@ -131,6 +131,18 @@ pub fn routes() -> Router {
|
|||
"/communities/{id}/supports_titles",
|
||||
get(communities::communities::supports_titles_request),
|
||||
)
|
||||
.route(
|
||||
"/communities/{id}/topics",
|
||||
post(communities::communities::add_topic_request),
|
||||
)
|
||||
.route(
|
||||
"/communities/{id}/topics/{id}",
|
||||
post(communities::communities::update_topic_request),
|
||||
)
|
||||
.route(
|
||||
"/communities/{id}/topics/{id}",
|
||||
delete(communities::communities::delete_topic_request),
|
||||
)
|
||||
// posts
|
||||
.route("/posts", post(communities::posts::create_request))
|
||||
.route("/posts/{id}", delete(communities::posts::delete_request))
|
||||
|
@ -778,6 +790,13 @@ pub struct UpdateCommunityJoinAccess {
|
|||
pub access: CommunityJoinAccess,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct AddTopic {
|
||||
pub title: String,
|
||||
pub description: String,
|
||||
pub color: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct CreatePostPoll {
|
||||
pub option_a: String,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue