Fix convert channel to private (#6568)

This commit is contained in:
Daniel Espino García 2022-08-12 23:09:23 +02:00 committed by GitHub
parent 6119ac46e1
commit 19c6ae86eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View file

@ -119,12 +119,7 @@ const ClientChannels = (superclass: any) => class extends superclass {
};
convertChannelToPrivate = async (channelId: string) => {
analytics.trackAPI('api_channels_convert_to_private', {channel_id: channelId});
return this.doFetch(
`${this.getChannelRoute(channelId)}/convert`,
{method: 'post'},
);
return this.updateChannelPrivacy(channelId, 'P');
};
updateChannelPrivacy = async (channelId: string, privacy: any) => {

View file

@ -277,7 +277,7 @@ describe('Actions.Channels', () => {
it('convertChannelToPrivate', async () => {
const publicChannel = TestHelper.basicChannel;
nock(Client4.getChannelRoute(publicChannel.id)).
post('/convert').
put('/privacy').
reply(200, {...TestHelper.basicChannel, type: General.PRIVATE_CHANNEL});
assert.equal(TestHelper.basicChannel.type, General.OPEN_CHANNEL);