{"record":{"id":"45bdf0604d01c1de","repo":"TryGhost/Ghost","slug":"failed-to-undislike-comment","errorCode":null,"errorMessage":"Failed to undislike comment","messagePattern":"Failed to undislike comment","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"apps/comments-ui/src/utils/api.ts","lineNumber":338,"sourceCode":"                });\n            },\n            undislike({comment}: {comment: {id: string}}) {\n                const body = {\n                    comments: [comment]\n                };\n                const url = endpointFor({type: 'members', resource: `comments/${comment.id}/dislike`});\n                return makeRequest({\n                    url,\n                    method: 'DELETE',\n                    headers: {\n                        'Content-Type': 'application/json'\n                    },\n                    body: JSON.stringify(body)\n                }).then(function (res) {\n                    if (res.ok) {\n                        return 'Success';\n                    } else {\n                        throw new Error('Failed to undislike comment');\n                    }\n                });\n            },\n            report({comment}: {comment: {id: string}}) {\n                const url = endpointFor({type: 'members', resource: `comments/${comment.id}/report`});\n                return makeRequest({\n                    url,\n                    method: 'POST',\n                    headers: {\n                        'Content-Type': 'application/json'\n                    }\n                }).then(function (res) {\n                    if (res.ok) {\n                        return 'Success';\n                    } else {\n                        throw new Error('Failed to report comment');\n                    }\n                });","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/TryGhost/Ghost/blob/47d8b0e2ad2fd4757d3bc45f46c3ac165ff8a1fe/apps/comments-ui/src/utils/api.ts#L320-L356","documentation":"comments.undislike() DELETEs /members/api/comments/{comment.id}/dislike with a body of {comments: [comment]} to remove a dislike. Returns 'Success' on ok, throws on non-ok. Structurally identical to unlike() but for the dislike reaction.","triggerScenarios":"The DELETE returns 4xx/5xx. The member did not dislike the comment (404/409), session expired (401), the comment was deleted (404), dislikes labs flag disabled (403), or server error (5xx).","commonSituations":"A member removes a dislike on a deleted comment. Labs flag toggled off mid-session. A race with another client already removing the dislike.","solutions":["Check the Network tab DELETE response status.","Optimistically toggle and revert on error; debounce the button.","If 404, sync local state to 'not disliked' since the target no longer exists.","If 403 due to labs, hide the dislike UI and refresh settings."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"setDisliked(false);\ntry {\n  await api.comments.undislike({comment});\n} catch (e) {\n  setDisliked(true);\n  if (e instanceof Error && e.message === 'Failed to undislike comment') {\n    // sync from server or refresh labs on 403\n  }\n}","preventionTips":["Disable the button during the DELETE; use optimistic UI with rollback.","On 404, sync local state to 'not disliked'.","On 403, refresh site settings — the dislikes labs flag may have been disabled."],"tags":["network","fetch","comments-ui","undislike","reaction","labs"],"backgroundTag":null,"analyzedSha":"47d8b0e2ad2fd4757d3bc45f46c3ac165ff8a1fe","analyzedAt":"2026-08-13T01:25:26.651Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}