File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import {
37
37
MuteChannelAPIResponse ,
38
38
PartialUpdateChannel ,
39
39
PartialUpdateChannelAPIResponse ,
40
+ PartialUpdateMember ,
40
41
PinnedMessagePaginationOptions ,
41
42
PinnedMessagesSort ,
42
43
QueryMembersOptions ,
@@ -298,6 +299,25 @@ export class Channel<StreamChatGenerics extends ExtendableGenerics = DefaultGene
298
299
) ;
299
300
}
300
301
302
+ /**
303
+ * partialUpdateMember - Partial update a member
304
+ *
305
+ * @param {string } user_id member user id
306
+ * @param {PartialUpdateMember<StreamChatGenerics> } updates
307
+ *
308
+ * @return {Promise<ChannelMemberResponse<StreamChatGenerics>> } Updated member
309
+ */
310
+ async partialUpdateMember ( user_id : string , updates : PartialUpdateMember < StreamChatGenerics > ) {
311
+ if ( ! user_id ) {
312
+ throw Error ( 'Please specify the user id' ) ;
313
+ }
314
+
315
+ return await this . getClient ( ) . put < ChannelMemberResponse < StreamChatGenerics > > (
316
+ this . _channelURL ( ) + `/member/${ encodeURIComponent ( user_id ) } ` ,
317
+ updates ,
318
+ ) ;
319
+ }
320
+
301
321
/**
302
322
* sendReaction - Send a reaction about a message
303
323
*
Original file line number Diff line number Diff line change @@ -2463,6 +2463,11 @@ export type PartialUpdateChannel<StreamChatGenerics extends ExtendableGenerics =
2463
2463
unset ?: Array < keyof ChannelResponse < StreamChatGenerics > > ;
2464
2464
} ;
2465
2465
2466
+ export type PartialUpdateMember < StreamChatGenerics extends ExtendableGenerics = DefaultGenerics > = {
2467
+ set ?: Partial < ChannelMemberResponse < StreamChatGenerics > > ;
2468
+ unset ?: Array < keyof ChannelMemberResponse < StreamChatGenerics > > ;
2469
+ } ;
2470
+
2466
2471
export type PartialUserUpdate < StreamChatGenerics extends ExtendableGenerics = DefaultGenerics > = {
2467
2472
id : string ;
2468
2473
set ?: Partial < UserResponse < StreamChatGenerics > > ;
You can’t perform that action at this time.
0 commit comments