Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3303 Rev 3371
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { useNavigate } from 'react-router-dom'
2
import { useNavigate } from 'react-router-dom'
3
import { useDispatch } from 'react-redux'
3
import { useDispatch } from 'react-redux'
Línea 4... Línea 4...
4
 
4
 
5
import {  useHabits } from '@hooks'
5
import { useHabits } from '@hooks'
6
import { saveHabit } from '@services/habits/habits'
6
import { saveHabit } from '@services/habits/habits'
Línea 7... Línea 7...
7
import { addNotification } from '@store/notification/notification.actions'
7
import { addNotification } from '@store/notification/notification.actions'
8
 
8
 
Línea 14... Línea 14...
14
  const dispatch = useDispatch()
14
  const dispatch = useDispatch()
Línea 15... Línea 15...
15
 
15
 
Línea 16... Línea 16...
16
  const { addUrl, addHabit } = useHabits()
16
  const { addUrl, addHabit } = useHabits()
17
 
-
 
18
  const onSubmit = async (habit) => {
17
 
19
    console.log(habit)
18
  const onSubmit = async (habit) => {
20
    try {
19
    try {
21
      const response = await saveHabit(addUrl, habit)
20
      const response = await saveHabit(addUrl, habit)
22
      dispatch(addNotification({ style: 'success', msg: response.message }))
21
      dispatch(addNotification({ style: 'success', msg: response.message }))