Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 11947 Rev 12141
Línea 67... Línea 67...
67
 
67
 
68
		axios.post(actionLink, formData)
68
		axios.post(actionLink, formData)
69
			.then(({ data }) => {
69
			.then(({ data }) => {
70
				if (!data.success) {
70
				if (!data.success) {
71
					dispatch(addNotification({
71
					dispatch(addNotification({
72
						style: 'error',
72
						style: 'danger',
73
						msg: 'Ha ocurrido un error'
73
						msg: typeof data.data === 'string' ? data.data : 'Ha ocurrido un error'
74
					}))
74
					}))
75
					return
75
					return
76
				}
76
				}
77
				history.goBack()
77
				history.goBack()
78
				dispatch(addNotification({
78
				dispatch(addNotification({
79
					style: 'success',
79
					style: 'success',
80
					msg: `Registro ${action === 'edit' ? 'actualizado' : 'guardado'}`
80
					msg: `Registro ${action === 'edit' ? 'actualizado' : 'guardado'}`
81
				}))
81
				}))
82
			})
82
			})
83
			.catch(() => dispatch(addNotification({
83
			.catch(() => dispatch(addNotification({
84
				style: 'error',
84
				style: 'danger',
85
				msg: 'Ha ocurrido un error'
85
				msg: 'Ha ocurrido un error'
Línea 86... Línea 86...
86
			})))
86
			})))