Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3719 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3719 Rev 3748
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { useDispatch } from 'react-redux';
2
import { useDispatch } from 'react-redux';
-
 
3
import { useNavigate } from 'react-router-dom';
Línea 3... Línea 4...
3
 
4
 
4
import { useHabitProgress } from '@hooks';
5
import { useHabitProgress } from '@hooks';
5
import { saveProgress } from '@services/habits/habits';
6
import { saveProgress } from '@services/habits/habits';
Línea 6... Línea 7...
6
import { addNotification } from '@store/notification/notification.actions';
7
import { addNotification } from '@store/notification/notification.actions';
7
 
8
 
8
import PageHeader from '@components/common/page-header';
9
import PageHeader from '@components/common/page-header';
Línea 9... Línea 10...
9
import LoadingWrapper from '@components/common/loading-wrapper';
10
import LoadingWrapper from '@components/common/loading-wrapper';
-
 
11
import ProgressForm from '@components/habits/progress/progress-form';
10
import ProgressForm from '@components/habits/progress/progress-form';
12
 
Línea 11... Línea 13...
11
 
13
export default function AddHabitProgress() {
Línea 12... Línea 14...
12
export default function AddHabitProgress() {
14
  const navigate = useNavigate();
13
  const dispatch = useDispatch();
15
  const dispatch = useDispatch();
14
 
16
 
15
  const { addUrl, loading, addItem } = useHabitProgress();
17
  const { addUrl, loading, addItem } = useHabitProgress();
16
 
18
 
-
 
19
  const onSubmit = async (progress) => {
17
  const onSubmit = async (progress) => {
20
    try {
18
    try {
21
      const response = await saveProgress(addUrl, progress);
19
      const response = await saveProgress(addUrl, progress);
22
      addItem(response.data);
20
      addItem(response.data);
23
      dispatch(addNotification({ style: 'success', msg: response.message }));