Servers: Add categories to server model.

This commit is contained in:
Paul
2021-06-27 00:13:35 +01:00
parent f35a1049da
commit a017872c99
4 changed files with 12 additions and 2 deletions

View File

@@ -1,3 +1,3 @@
#!/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

View File

@@ -46,6 +46,13 @@ pub struct Role {
// 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)]
pub struct Ban {
#[serde(rename = "_id")]
@@ -81,6 +88,8 @@ pub struct Server {
pub channels: Vec<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub categories: Option<Vec<Category>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub system_messages: Option<SystemMessageChannels>,
#[serde(default = "HashMap::new", skip_serializing_if = "HashMap::is_empty")]

View File

@@ -55,6 +55,7 @@ pub async fn req(user: User, info: Json<Data>) -> Result<JsonValue> {
description: info.description,
channels: vec![cid.clone()],
categories: None,
system_messages: Some(SystemMessageChannels {
user_joined: Some(cid.clone()),
user_left: Some(cid.clone()),

View File

@@ -1 +1 @@
pub const VERSION: &str = "0.5.1-alpha.1-patch.0";
pub const VERSION: &str = "0.5.1-alpha.2";