Servers: Add description field.

API: Allow removal of description on channels and servers.
This commit is contained in:
Paul
2021-06-06 10:55:31 +01:00
parent 380369e1c4
commit 0af4fa4be9
5 changed files with 19 additions and 1 deletions

View File

@@ -11,6 +11,8 @@ use validator::Validate;
pub struct Data {
#[validate(length(min = 1, max = 32))]
name: String,
#[validate(length(min = 0, max = 1024))]
description: Option<String>,
// Maximum length of 36 allows both ULIDs and UUIDs.
#[validate(length(min = 1, max = 36))]
nonce: String,
@@ -48,6 +50,7 @@ pub async fn req(user: User, info: Json<Data>) -> Result<JsonValue> {
owner: user.id.clone(),
name: info.name,
description: info.description,
channels: vec![cid.clone()],
icon: None,