Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHAT-1823] Add async deleteChannels endpoint #769

Merged
merged 5 commits into from
Oct 6, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3305,4 +3305,22 @@ export class StreamChat<
async getTask(id: string) {
return this.get<APIResponse & TaskStatus>(`${this.baseURL}/tasks/${id}`);
}

/**
* deleteChannels - Deletes a list of channel
*
* @param {string[]} cids Channel CIDs
* @param {hard_delete?: boolean} hard_delete Defines if the channel is hard deleted or not
mahboubii marked this conversation as resolved.
Show resolved Hide resolved
*
* @return {APIResponse} A task ID
*/
async deleteChannels(
cids: string[],
hard_delete?: boolean,
) {
return await this.post<APIResponse>(this.baseURL + `/channels/delete`, {
yaziine marked this conversation as resolved.
Show resolved Hide resolved
cids,
hard_delete,
});
}
}