mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-20 16:45:16 +00:00
Can set for friends if they can create posts or not
This commit is contained in:
@ -265,6 +265,26 @@ export class FriendsHelper {
|
||||
}) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the post creation authorization status
|
||||
*
|
||||
* @param userID The ID of the user updating the authorization status
|
||||
* @param friendID The ID of the target friend
|
||||
* @param allow New authorization status
|
||||
*/
|
||||
public static async SetCanPostTexts(userID: number, friendID: number, allow: boolean) {
|
||||
await DatabaseHelper.UpdateRows({
|
||||
table: FRIENDS_TABLE,
|
||||
where: {
|
||||
ID_personne: userID,
|
||||
ID_amis: friendID
|
||||
},
|
||||
set: {
|
||||
autoriser_post_page: allow ? 1 : 0
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check out whether friendship allows to create posts or not
|
||||
*
|
||||
|
Reference in New Issue
Block a user