Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Edit Post patches only message, leaves props unchanged (#9616)
Browse files Browse the repository at this point in the history
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
  • Loading branch information
levb and mattermod committed Jan 25, 2022
1 parent a1d20ac commit 8a925e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/edit_post_modal/edit_post_modal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ describe('components/EditPostModal', () => {
await Promise.resolve();
expect(actions.addMessageIntoHistory).toBeCalledWith('new message');
expect(actions.editPost).toBeCalledWith({
...defaultPost,
id: defaultPost.id,
message: 'new message',
});
expect(actions.hideEditPostModal).toBeCalled();
Expand Down
6 changes: 5 additions & 1 deletion components/edit_post_modal/edit_post_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ export class EditPostModal extends React.PureComponent<Props, State> {

actions.addMessageIntoHistory(updatedPost.message);

const data = await actions.editPost(updatedPost);
// Only message is getting updated, no other patchable attributes.
const data = await actions.editPost({
id: updatedPost.id,
message: updatedPost.message,
});
if (data) {
window.scrollTo(0, 0);
}
Expand Down

0 comments on commit 8a925e8

Please sign in to comment.