Group creation request with createGroup()

Question:
Is it possible to send group creation request to the dashboard from code ?

Product:
Wix Editor

What are you trying to achieve:
I’m trying to use the createGroup() backend function so that when a member creates a group through a custom form, a request is sent to the website dashboard.
I’ve selected the correct parameters (“member with approval”) in the group settings, but when I try to create a group using the test website while logged in as a member, I get a “Forbidden” error when createGroup is called.

The “Create Group” button inside the Groups Feed correctly sends a request to the dashboard, but when triggered via code, it doesn’t work.

What have you already tried:
Elevating the function, changing the group settings parameters. It just let the member create the group without sending the request.

Backend code :

import { groups } from "wix-groups-backend"; 
import {webMethod, Permissions } from "wix-web-module"; 

export const myCreateGroupFunction = webMethod( Permissions.SiteMember,
  (groupInfo, options) => { 
    return groups 
    .createGroup(groupInfo, options)
    .then((createdGroup) => { 
       return createdGroup; 
    }) 
    .catch((error) => { 
        console.error(error); 
    }); 
  }, 
);

I would try functional testing on your backend method with the following input parameters:

{
    "groupInfo": {
        "name": "My New Group"
    },
    "options": null
}

If the promise resolves, this means there might be a issue with the parameter being passed to the backend method. It is also possible there are permission issues on the page with the custom request form.

The promise resolves correctly when testing, but instead of creating a group request, it directly creates the group. I assume this is because when testing I’m using the function as an admin.

The groupInfo parameter only contains the group’s name and description, and the options parameter includes the member ID (not useful here).
My custom form works when I let members create groups without approval so the problem doesn’t come from the parameters.

The page with the custom form is simply restricted to members but nothing more.

I just don’t understand why the function doesn’t behave as described in the documentation :
“If set to admin approval required, a site member uses the createGroup() function to create a group, and the group becomes a createRequest with a status of PENDING.”