Proyectos de Subversion LeadersLinked - Backend

Rev

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

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