From eb817966a498252c3e7c70d02b82f48c94aabb97 Mon Sep 17 00:00:00 2001 From: Harshil Sharma <18575143+harshilsharma63@users.noreply.github.com> Date: Thu, 21 Mar 2024 17:12:03 +0530 Subject: [PATCH] Passed actual channel data to action instead of HTTP response (#26315) * Passed actual channel data to action instead of HTTP response * Fixed type * Fixed type --- .../mattermost-redux/src/actions/channels.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/webapp/channels/src/packages/mattermost-redux/src/actions/channels.ts b/webapp/channels/src/packages/mattermost-redux/src/actions/channels.ts index 72ddd3780c..44255dc306 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/actions/channels.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/actions/channels.ts @@ -271,11 +271,11 @@ export function updateChannelPrivacy(channelId: string, privacy: string): Action }); } -export function convertGroupMessageToPrivateChannel(channelID: string, teamID: string, displayName: string, name: string): ActionFuncAsync { +export function convertGroupMessageToPrivateChannel(channelID: string, teamID: string, displayName: string, name: string): ActionFuncAsync { return async (dispatch, getState) => { - let updatedChannel; + let response; try { - updatedChannel = await Client4.convertGroupMessageToPrivateChannel(channelID, teamID, displayName, name); + response = await Client4.convertGroupMessageToPrivateChannel(channelID, teamID, displayName, name); } catch (error) { forceLogoutIfNecessary(error, dispatch, getState); dispatch(logError(error)); @@ -284,7 +284,7 @@ export function convertGroupMessageToPrivateChannel(channelID: string, teamID: s dispatch({ type: ChannelTypes.RECEIVED_CHANNEL, - data: updatedChannel, + data: response.data, }); // move the channel from direct message category to the default "channels" category @@ -293,7 +293,9 @@ export function convertGroupMessageToPrivateChannel(channelID: string, teamID: s return {}; } - return updatedChannel; + return { + data: response.data, + }; }; }