Fix convert channel to private (#6568) (#6610)

This commit is contained in:
Mattermost Build 2022-09-01 15:21:38 +03:00 committed by GitHub
parent 242af6603d
commit 7ef2ec982a
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);