Group member add and remove routes.
This commit is contained in:
@@ -36,6 +36,12 @@ pub async fn req(user: User, info: Json<Data>) -> Result<JsonValue> {
|
||||
})?
|
||||
}
|
||||
|
||||
for target in &set {
|
||||
if get_relationship(&user, target) != RelationshipStatus::Friend {
|
||||
Err(Error::NotFriends)?
|
||||
}
|
||||
}
|
||||
|
||||
if get_collection("channels")
|
||||
.find_one(
|
||||
doc! {
|
||||
@@ -53,12 +59,6 @@ pub async fn req(user: User, info: Json<Data>) -> Result<JsonValue> {
|
||||
Err(Error::DuplicateNonce)?
|
||||
}
|
||||
|
||||
for target in &set {
|
||||
if get_relationship(&user, target) != RelationshipStatus::Friend {
|
||||
Err(Error::NotFriends)?
|
||||
}
|
||||
}
|
||||
|
||||
let id = Ulid::new().to_string();
|
||||
let channel = Channel::Group {
|
||||
id,
|
||||
|
||||
Reference in New Issue
Block a user