Merge branch 'comment-edit-and-remove-fix' into 'dev'

comments edit and remove fix

See merge request discoursio/discoursio-webapp!30
This commit is contained in:
Igor 2023-02-25 14:17:11 +00:00
commit dc85e222b6
2 changed files with 5 additions and 1 deletions

View File

@ -47,7 +47,10 @@ export const ReactionsProvider = (props: { children: JSX.Element }) => {
const deleteReaction = async (id: number): Promise<void> => {
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<void> => {

View File

@ -5,6 +5,7 @@ export default gql`
updateReaction(id: $id, reaction: $reaction) {
error
reaction {
id
body
updatedAt
replyTo