Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit c4b6207

Browse files
authored
Merge pull request #4659 from withspectrum/fix-editing-messages
[HOTFIX] Fix editing messages
2 parents d440204 + d05c213 commit c4b6207

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/mutations/message/editMessage.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ type Args = {
2929
};
3030

3131
export default requireAuth(async (_: any, args: Args, ctx: GraphQLContext) => {
32+
let messageType = args.input.messageType;
3233
const {
33-
input: { id, content, messageType },
34+
input: { id, content },
3435
} = args;
3536
const { user, loaders } = ctx;
3637

@@ -58,9 +59,8 @@ export default requireAuth(async (_: any, args: Args, ctx: GraphQLContext) => {
5859
})
5960
)
6061
);
61-
messageType === 'draftjs';
62+
messageType = 'draftjs';
6263
}
63-
6464
const eventFailed =
6565
message.threadType === 'story'
6666
? events.MESSAGE_EDITED_FAILED
@@ -84,7 +84,7 @@ export default requireAuth(async (_: any, args: Args, ctx: GraphQLContext) => {
8484
'Please provide serialized raw DraftJS content state as content.body'
8585
);
8686
}
87-
if (!validateRawContentState(body)) {
87+
if (!validateRawContentState(parsed)) {
8888
trackQueue.add({
8989
userId: user.id,
9090
event: eventFailed,

0 commit comments

Comments
 (0)