Update Group
Use updateGroup() to modify group details. Pass a Group object with the updated values.
const GUID : string = "GUID" ;
const groupName : string = "Hello Group!" ;
const groupType : string = CometChat . GROUP_TYPE . PUBLIC ;
const group : CometChat . Group = new CometChat . Group ( GUID , groupName , groupType );
CometChat . updateGroup ( group ). then (
( group : CometChat . Group ) => {
console . log ( "Group details updated successfully:" , group );
}, ( error : CometChat . CometChatException ) => {
console . log ( "Group details update failed with exception:" , error );
}
);
const GUID = "GUID" ;
const groupName = "Hello Group" ;
const groupType = CometChat . GROUP_TYPE . PUBLIC ;
const group = new CometChat . Group ( GUID , groupName , groupType );
CometChat . updateGroup ( group ). then (
group => {
console . log ( "Groups details updated successfully:" , group );
}, error => {
console . log ( "Group details update failed with exception:" , error );
}
);
Parameter Description groupAn instance of Group class with updated values
On success, returns a Group object with the updated details.
There is no real-time event listener for group updates. To get the latest
group information after calling updateGroup(), fetch the group details again
using getGroup().
Next Steps
Delete Group Permanently delete a group
Retrieve Groups Fetch and filter groups with pagination