mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-21 00:45:18 +00:00
Can send friendship request
This commit is contained in:
@ -61,7 +61,16 @@ fn get_list(friend_query: &GetFriendsQuery) -> ResultBoxError<Vec<Friend>> {
|
||||
query.exec(db_to_friend)
|
||||
}
|
||||
|
||||
/// Check out wheterher a user has sent a request to another user
|
||||
/// Send a new friendship request
|
||||
pub fn send_request(user_id: &UserID, target_user: &UserID) -> ResultBoxError {
|
||||
database::InsertQuery::new(FRIENDS_TABLE)
|
||||
.add_user_id("ID_personne", target_user)
|
||||
.add_user_id("ID_amis", user_id)
|
||||
.add_legacy_bool("actif", false)
|
||||
.insert_drop_result()
|
||||
}
|
||||
|
||||
/// Check out whether a user has sent a request to another user
|
||||
pub fn sent_request(user_id: &UserID, target_user: &UserID) -> ResultBoxError<bool> {
|
||||
database::QueryInfo::new(FRIENDS_TABLE)
|
||||
.cond_user_id("ID_personne", target_user)
|
||||
|
Reference in New Issue
Block a user