forked from jmug/stoatchat
Emergency patch; Rust MDB driver deletes doc. with empty update.
This commit is contained in:
@@ -26,6 +26,10 @@ pub async fn req(user: User, target: Ref, data: Json<Data>) -> Result<()> {
|
||||
data.validate()
|
||||
.map_err(|error| Error::FailedValidation { error })?;
|
||||
|
||||
if data.name.is_none() || data.description.is_none() || data.icon.is_none() || data.remove.is_none() {
|
||||
return Ok(())
|
||||
}
|
||||
|
||||
let target = target.fetch_channel().await?;
|
||||
let perm = permissions::PermissionCalculator::new(&user)
|
||||
.with_channel(&target)
|
||||
|
||||
Reference in New Issue
Block a user