mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-07-15 22:28:04 +00:00
Can update following status of a group
This commit is contained in:
src
@ -537,6 +537,21 @@ export class GroupsController {
|
||||
h.success("Your membership has been successfully deleted!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update the following status of a user
|
||||
*
|
||||
* @param h Request handler
|
||||
*/
|
||||
public static async SetFollowing(h: RequestHandler) {
|
||||
const groupID = await h.postGroupIDWithAccess("groupID", GroupsAccessLevel.MEMBER_ACCESS);
|
||||
const following = h.postBool("follow");
|
||||
|
||||
await GroupsHelper.SetFollowing(groupID, h.getUserId(), following);
|
||||
|
||||
h.success("Follow status has been successfully updated!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn a GroupInfo object into a valid API object
|
||||
*
|
||||
|
@ -126,4 +126,6 @@ export const Routes : Route[] = [
|
||||
{path: "/groups/cancel_invitation", cb: (h) => GroupsController.CancelInvitation(h)},
|
||||
|
||||
{path: "/groups/remove_membership", cb: (h) => GroupsController.RemoveMembership(h)},
|
||||
|
||||
{path: "/groups/set_following", cb: (h) => GroupsController.SetFollowing(h)},
|
||||
]
|
Reference in New Issue
Block a user