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:
commit
dc85e222b6
|
@ -47,7 +47,10 @@ export const ReactionsProvider = (props: { children: JSX.Element }) => {
|
||||||
const deleteReaction = async (id: number): Promise<void> => {
|
const deleteReaction = async (id: number): Promise<void> => {
|
||||||
const reaction = await apiClient.destroyReaction(id)
|
const reaction = await apiClient.destroyReaction(id)
|
||||||
console.debug('[deleteReaction]:', reaction.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> => {
|
const updateReaction = async (id: number, input: ReactionInput): Promise<void> => {
|
||||||
|
|
|
@ -5,6 +5,7 @@ export default gql`
|
||||||
updateReaction(id: $id, reaction: $reaction) {
|
updateReaction(id: $id, reaction: $reaction) {
|
||||||
error
|
error
|
||||||
reaction {
|
reaction {
|
||||||
|
id
|
||||||
body
|
body
|
||||||
updatedAt
|
updatedAt
|
||||||
replyTo
|
replyTo
|
||||||
|
|
Loading…
Reference in New Issue
Block a user