1
0
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:
2020-01-01 15:08:15 +01:00
parent 4cfb85d1ad
commit bb47968626
3 changed files with 36 additions and 0 deletions

View File

@ -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
*