Fetch All
/api/v2/group/fetch
Post
groups
jwt
pgn
Purpose
To allow a user to fetch groups that he/she is a member of or to have some details about those that are public.
Body Content [input]
{
    uid: string
}
Returns if valid [output]
{
    groups: {
        groupID: string,
        name: string,
        description: string,
        privacy: string,
        icon: string,
        cover_image: string,
        members: {
            uid: string,
            is_admin: bool,
            status: string
        }[]
    }[],
    error: 0,
    amount: int
}
What the API does
- Finds all records from the 
groupscollection. - Filters out all records not having a 
uidin themembersfield corresponding to the one passed if they have a value ofprivatefor theirprivacyfield. - Removes the 
has_mutedfield for each record in theirmembersfield. - Sets empty values for 
membersifuiddoes not correspond to a record in themembersfield with astatusofaccepted.