Skip to content

Commit

Permalink
Add deleteChannels and getTask methods
Browse files Browse the repository at this point in the history
  • Loading branch information
yaziine committed Sep 13, 2021
1 parent 33f627f commit 55c752a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3281,4 +3281,33 @@ export class StreamChat<
);
return campaign;
}

/**
* 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
*
* @return {APIResponse} A task ID
*/
async deleteChannels(
cids: string[],
hard_delete?: boolean,
) {
return await this.post<APIResponse>(this.baseURL + `/channels/delete`, {
cids,
hard_delete,
});
}

/**
* getTask - Gets a task
*
* @param {string} id Task ID
*
* @return {APIResponse} The task status
*/
async getTask(id: string) {
return this.get<APIResponse>(`${this.baseURL}/tasks/${id}`);
}
}

0 comments on commit 55c752a

Please sign in to comment.