(postId, commentId)
| 145 | |
| 146 | // Delete comment |
| 147 | export const deleteComment = (postId, commentId) => async (dispatch) => { |
| 148 | try { |
| 149 | await api.delete(`/posts/comment/${postId}/${commentId}`); |
| 150 | |
| 151 | dispatch({ |
| 152 | type: REMOVE_COMMENT, |
| 153 | payload: commentId |
| 154 | }); |
| 155 | |
| 156 | dispatch(setAlert('Comment Removed', 'success')); |
| 157 | } catch (err) { |
| 158 | dispatch({ |
| 159 | type: POST_ERROR, |
| 160 | payload: { msg: err.response.statusText, status: err.response.status } |
| 161 | }); |
| 162 | } |
| 163 | }; |
nothing calls this directly
no test coverage detected