diff --git a/src/context/reactions.tsx b/src/context/reactions.tsx index bd3c7ba9..af9d9b6a 100644 --- a/src/context/reactions.tsx +++ b/src/context/reactions.tsx @@ -47,7 +47,10 @@ export const ReactionsProvider = (props: { children: JSX.Element }) => { const deleteReaction = async (id: number): Promise => { const reaction = await apiClient.destroyReaction(id) console.debug('[deleteReaction]:', reaction.id) - setReactionEntities(({ [reaction.id]: _deletedReaction, ...rest }) => rest) + setReactionEntities((oldState) => ({ + ...oldState, + [reaction.id]: undefined + })) } const updateReaction = async (id: number, input: ReactionInput): Promise => { diff --git a/src/graphql/mutation/reaction-update.ts b/src/graphql/mutation/reaction-update.ts index c9650ae5..6ed8a35a 100644 --- a/src/graphql/mutation/reaction-update.ts +++ b/src/graphql/mutation/reaction-update.ts @@ -5,6 +5,7 @@ export default gql` updateReaction(id: $id, reaction: $reaction) { error reaction { + id body updatedAt replyTo