Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3630 Rev 3632
Línea 10... Línea 10...
10
 
10
 
11
export function useConversations() {
11
export function useConversations() {
12
  const { uuid } = useParams();
12
  const { uuid } = useParams();
13
  const [conversations, setConversations] = useState([]);
13
  const [conversations, setConversations] = useState([]);
-
 
14
  const [currentConversation, setCurrentConversation] = useState(null);
Línea 14... Línea 15...
14
  const [currentConversation, setCurrentConversation] = useState(null);
15
  const [deletedUrl, setDeletedUrl] = useState(null);
15
 
16
 
16
  const { showSuccess, showError } = useAlert();
17
  const { showSuccess, showError } = useAlert();
Línea 25... Línea 26...
25
      showError(error.message);
26
      showError(error.message);
26
    }
27
    }
27
  });
28
  });
Línea 28... Línea 29...
28
 
29
 
-
 
30
  const { execute: executeDeleteConversation } = useApi(deleteConversationService, {
-
 
31
    onSuccess: (data) => {
-
 
32
      showSuccess(data);
-
 
33
      setConversations((prev) => prev.filter((c) => c.delete_url !== deletedUrl));
-
 
34
      closeAlert();
29
  const { execute: executeDeleteConversation } = useApi(deleteConversationService, {
35
    },
30
    onError: (error) => {
36
    onError: (error) => {
31
      showError(error.message);
37
      showError(error.message);
32
    }
38
    }
Línea 33... Línea 39...
33
  });
39
  });
34
 
40
 
35
  const handleDeleteConversation = async (url) => {
-
 
36
    executeDeleteConversation(url).then((data) => {
-
 
37
      showSuccess(data);
-
 
38
      setConversations((prev) => prev.filter((c) => c.deleted_url !== url));
-
 
39
      closeAlert();
41
  const handleDeleteConversation = async (url) => {
Línea 40... Línea 42...
40
    });
42
    executeDeleteConversation(url);
-
 
43
  };
41
  };
44
 
42
 
45
  const deleteConversation = (url) => {
43
  const deleteConversation = (url) => {
46
    setDeletedUrl(url);
44
    showAlert({
47
    showAlert({
45
      title: 'Borrar conversación',
48
      title: 'Borrar conversación',