Gets a group by ID.
The getGroup()
function returns a Promise that resolves to a group whose ID matches the given ID.
Note: For SECRET
groups, only site admins, group admins, and group members can see a group and its content.
function getGroup(groupId: string, options: GetGroupOptions): Promise<Group>;
ID of the group to retrieve.
import { groups } from "wix-groups.v2";
async function getGroup(groupId, options) {
try {
const result = await groups.getGroup(groupId, options);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.