Skip to content
Snippets Groups Projects
Commit a017872c authored by insert's avatar insert
Browse files

Servers: Add categories to server model.

parent f35a1049
No related merge requests found
#!/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
......@@ -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")]
......
......@@ -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()),
......
pub const VERSION: &str = "0.5.1-alpha.1-patch.0";
pub const VERSION: &str = "0.5.1-alpha.2";
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment