Servers: Add categories to server model.
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export version=0.5.1-alpha.1-patch.0
|
export version=0.5.1-alpha.2
|
||||||
echo "pub const VERSION: &str = \"${version}\";" > src/version.rs
|
echo "pub const VERSION: &str = \"${version}\";" > src/version.rs
|
||||||
|
|||||||
@@ -46,6 +46,13 @@ pub struct Role {
|
|||||||
// Bri'ish API conventions
|
// Bri'ish API conventions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
pub struct Category {
|
||||||
|
pub id: String,
|
||||||
|
pub title: String,
|
||||||
|
pub channels: Vec<String>
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
pub struct Ban {
|
pub struct Ban {
|
||||||
#[serde(rename = "_id")]
|
#[serde(rename = "_id")]
|
||||||
@@ -81,6 +88,8 @@ pub struct Server {
|
|||||||
|
|
||||||
pub channels: Vec<String>,
|
pub channels: Vec<String>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub categories: Option<Vec<Category>>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub system_messages: Option<SystemMessageChannels>,
|
pub system_messages: Option<SystemMessageChannels>,
|
||||||
|
|
||||||
#[serde(default = "HashMap::new", skip_serializing_if = "HashMap::is_empty")]
|
#[serde(default = "HashMap::new", skip_serializing_if = "HashMap::is_empty")]
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ pub async fn req(user: User, info: Json<Data>) -> Result<JsonValue> {
|
|||||||
description: info.description,
|
description: info.description,
|
||||||
|
|
||||||
channels: vec![cid.clone()],
|
channels: vec![cid.clone()],
|
||||||
|
categories: None,
|
||||||
system_messages: Some(SystemMessageChannels {
|
system_messages: Some(SystemMessageChannels {
|
||||||
user_joined: Some(cid.clone()),
|
user_joined: Some(cid.clone()),
|
||||||
user_left: Some(cid.clone()),
|
user_left: Some(cid.clone()),
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
pub const VERSION: &str = "0.5.1-alpha.1-patch.0";
|
pub const VERSION: &str = "0.5.1-alpha.2";
|
||||||
|
|||||||
Reference in New Issue
Block a user