mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-20 00:25:17 +00:00
Can update following status of a group
This commit is contained in:
@ -254,6 +254,26 @@ export class GroupsHelper {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update following status of a user
|
||||
*
|
||||
* @param groupID Target group ID
|
||||
* @param userID Target user ID
|
||||
* @param follow true to follow / false else
|
||||
*/
|
||||
public static async SetFollowing(groupID: number, userID: number, follow: boolean) {
|
||||
await DatabaseHelper.UpdateRows({
|
||||
table: GROUPS_MEMBERS_TABLE,
|
||||
where: {
|
||||
groups_id: groupID,
|
||||
user_id: userID
|
||||
},
|
||||
set: {
|
||||
following: follow ? 1 : 0
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete completely a user membership
|
||||
*
|
||||
|
Reference in New Issue
Block a user