CommunityClient
CommunityClient:
TypedEventEmitter<CommunityEvents> &object
Type declaration
edit()
Parameters
| Parameter | Type |
|---|---|
request | CommunityEditRequest |
Returns
Promise<Community>
Example
import {
Community,
CommunityEditRequest,
rootServer,
} from "@rootsdk/server-app";
export async function editExample(): Promise<Community> {
try {
// Set up the request
const request: CommunityEditRequest = {
name: "MyNewCommunityName",
pictureHex: "#FF0000",
updatePicture: false,
pictureTokenUri: undefined,
defaultChannelId: undefined,
rejectUnverifiedEmail: false,
};
// Call the API
const community: Community =
await rootServer.community.communities.edit(request);
return community;
} catch (error) {
// Detect error
throw error;
}
}
get()
Returns
Promise<Community>
Example
import { Community, rootServer } from "@rootsdk/server-app";
export async function getExample(): Promise<Community> {
try {
// Call the API
const community: Community = await rootServer.community.communities.get();
return community;
} catch (error) {
// Detect error
throw error;
}
}