Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 11684 Rev 14843
Línea 44... Línea 44...
44
		})
44
		})
Línea 45... Línea 45...
45
 
45
 
46
		axios.post(action_link, submitData)
46
		axios.post(action_link, submitData)
47
			.then(({ data }) => {
47
			.then(({ data }) => {
-
 
48
				if (!data.success) {
-
 
49
					typeof data.data === 'string'
48
				if (!data.success) {
50
						?
49
					return dispatch(addNotification({
51
						dispatch(addNotification({
50
						style: 'danger',
52
							style: 'danger',
51
						msg: 'Ha ocurrido un error'
53
							msg: data.data
-
 
54
						}))
-
 
55
						: Object.entries(data.data).map(([key, value]) =>
-
 
56
							value.map(err =>
-
 
57
								dispatch(addNotification({
-
 
58
									style: 'danger',
-
 
59
									msg: `${key}: ${err}`
-
 
60
								}))
-
 
61
							)
-
 
62
						)
52
					}))
63
					return
Línea 53... Línea 64...
53
				}
64
				}
54
 
65
 
55
				clearErrors()
66
				clearErrors()