summaryrefslogtreecommitdiffstats
path: root/webapp/components/edit_post_modal.jsx
diff options
context:
space:
mode:
authorMika Andrianarijaona <mikaoelitiana@users.noreply.github.com>2017-01-13 16:48:49 +0300
committerenahum <nahumhbl@gmail.com>2017-01-13 10:48:49 -0300
commite69809dce3708b7ba28a7475c8babbb429ca601c (patch)
treed4e677245959abe583b140feb25fba607cd83e18 /webapp/components/edit_post_modal.jsx
parent6c814c72ec8fc5ec5f17c657d2af8fafa67b1e33 (diff)
downloadchat-e69809dce3708b7ba28a7475c8babbb429ca601c.tar.gz
chat-e69809dce3708b7ba28a7475c8babbb429ca601c.tar.bz2
chat-e69809dce3708b7ba28a7475c8babbb429ca601c.zip
GH-4907 Move Client.updatePost call into an action (#5045)
* move Client.updatePost into an action Client.updatePost where called from components so they needed to be moved inside action and call that action from component instead fixes #4907 * move loadPost in updatePost callback * Add loadPosts call in updatePost action * Lint: remove trailing spaces
Diffstat (limited to 'webapp/components/edit_post_modal.jsx')
-rw-r--r--webapp/components/edit_post_modal.jsx13
1 files changed, 3 insertions, 10 deletions
diff --git a/webapp/components/edit_post_modal.jsx b/webapp/components/edit_post_modal.jsx
index 2108ec3d1..55bf5fe60 100644
--- a/webapp/components/edit_post_modal.jsx
+++ b/webapp/components/edit_post_modal.jsx
@@ -9,11 +9,9 @@ import MessageHistoryStore from 'stores/message_history_store.jsx';
import PreferenceStore from 'stores/preference_store.jsx';
import * as GlobalActions from 'actions/global_actions.jsx';
-import {loadPosts} from 'actions/post_actions.jsx';
+import {updatePost} from 'actions/post_actions.jsx';
-import Client from 'client/web_client.jsx';
import * as UserAgent from 'utils/user_agent.jsx';
-import * as AsyncClient from 'utils/async_client.jsx';
import * as Utils from 'utils/utils.jsx';
import Constants from 'utils/constants.jsx';
const KeyCodes = Constants.KeyCodes;
@@ -91,16 +89,11 @@ export default class EditPostModal extends React.Component {
return;
}
- Client.updatePost(
+ updatePost(
updatedPost,
() => {
- loadPosts(updatedPost.channel_id);
window.scrollTo(0, 0);
- },
- (err) => {
- AsyncClient.dispatchError(err, 'updatePost');
- }
- );
+ });
$('#edit_post').modal('hide');
}