1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-20 08:35:17 +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

@ -181,6 +181,20 @@ export class FriendsController {
h.success("Following status upated!");
}
/**
* Update post text authorization status
*
* @param h Request handler
*/
public static async SetCanPostTexts(h: RequestHandler) {
const friendID = await h.postFriendId("friendID");
const allow = h.postBool("allow");
await FriendsHelper.SetCanPostTexts(h.getUserId(), friendID, allow);
h.success("Updated status!");
}
/**
* Turn a friend object into an API entry
*

View File

@ -93,6 +93,8 @@ export const Routes : Route[] = [
{path: "/friends/setFollowing", cb: (h) => FriendsController.SetFollowing(h)},
{path: "/friends/set_can_post_texts", cb: (h) => FriendsController.SetCanPostTexts(h)},
// Conversations controller
{path: "/conversations/create", cb: (h) => ConversationsController.CreateConversation(h)},