mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
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
This commit is contained in:
parent
959e333031
commit
eb817966a4
@ -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<Channel> {
|
||||
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,
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user