Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 974 | Rev 985 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 974 Rev 975
Línea 132... Línea 132...
132
 
132
 
133
  const deleteCommentHandler = (commentUnique, deleteCommentUrl) => {
133
  const deleteCommentHandler = (commentUnique, deleteCommentUrl) => {
134
    axios
134
    axios
135
      .post(deleteCommentUrl)
135
      .post(deleteCommentUrl)
136
      .then((res) => {
136
      .then((res) => {
137
        const { success, data } = res.data;
137
        const { success, data, total_comments } = res.data;
138
        if (success) {
138
        if (success) {
139
          const newCommentsState = commentsState.filter(
139
          const newCommentsState = commentsState.filter(
140
            (comment) => comment.unique !== commentUnique
140
            (comment) => comment.unique !== commentUnique
141
          );
141
          );
142
          setCommentsState(newCommentsState);
142
          setCommentsState(newCommentsState);
143
          setTotalComments(data.total_comments);
143
          setTotalComments(total_comments);
144
        } else {
144
        } else {
145
          addNotification({
145
          addNotification({
146
            style: "danger",
146
            style: "danger",
147
            msg: data,
147
            msg: data,