Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 12187 Rev 14843
Línea 27... Línea 27...
27
		})
27
		})
Línea 28... Línea 28...
28
 
28
 
29
		axios.post(action_link, submitData)
29
		axios.post(action_link, submitData)
30
			.then(({ data }) => {
30
			.then(({ data }) => {
-
 
31
				if (!data.success) {
-
 
32
					typeof data.data === 'string'
31
				if (!data.success) {
33
						?
32
					return dispatch(addNotification({
34
						dispatch(addNotification({
33
						style: 'danger',
35
							style: 'danger',
34
						msg: 'Ha ocurrido un error'
36
							msg: data.data
-
 
37
						}))
-
 
38
						: Object.entries(data.data).map(([key, value]) =>
-
 
39
							value.map(err =>
-
 
40
								dispatch(addNotification({
-
 
41
									style: 'danger',
-
 
42
									msg: `${key}: ${err}`
-
 
43
								}))
-
 
44
							)
-
 
45
						)
35
					}))
46
					return
Línea 36... Línea 47...
36
				}
47
				}
37
 
48
 
38
				clearErrors()
49
				clearErrors()