Write proper user permission code.

This commit is contained in:
Paul Makles
2021-01-09 16:50:11 +00:00
parent bb3667a83b
commit 5e70ceea01
9 changed files with 59 additions and 55 deletions

View File

@@ -33,9 +33,7 @@ pub async fn req(user: User, username: String) -> Result<JsonValue> {
match get_relationship(
&user,
&Ref {
id: target_id.to_string(),
},
&target_id,
) {
RelationshipStatus::User => return Err(Error::NoEffect),
RelationshipStatus::Friend => return Err(Error::AlreadyFriends),