📦 NEW: backend PUT /comments

This commit is contained in:
Divlo
2020-05-04 17:19:51 +02:00
parent 6848c790ed
commit ea5ee96845
5 changed files with 86 additions and 66 deletions

View File

@ -14,7 +14,7 @@ const CommentCard = forwardRef((props, ref) => {
props.manageComment.setLoadingComments(true);
if (isAuth && user.token != undefined) {
try {
await api.delete(`/comments?commentId=${props.id}`, { headers: { 'Authorization': user.token } });
await api.delete(`/comments/${props.id}`, { headers: { 'Authorization': user.token } });
const newCommentsData = { ...props.manageComment.commentsData };
const commentIndex = newCommentsData.rows.findIndex((value) => value.id === props.id);
newCommentsData.rows.splice(commentIndex, 1);