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:
@ -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
|
||||
*
|
||||
|
@ -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)},
|
||||
|
Reference in New Issue
Block a user