Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 11237 Rev 14738
Línea 37... Línea 37...
37
		})
37
		})
Línea 38... Línea 38...
38
 
38
 
39
		axios.post(add_link, submitData)
39
		axios.post(add_link, submitData)
40
			.then(({ data }) => {
40
			.then(({ data }) => {
-
 
41
				if (!data.success) {
-
 
42
					typeof data.data === 'string'
41
				if (!data.success) {
43
						?
42
					return dispatch(addNotification({
44
						dispatch(addNotification({
43
						style: 'danger',
45
							style: 'danger',
44
						msg: 'Ha ocurrido un error'
46
							msg: data.data
-
 
47
						}))
-
 
48
						: Object.entries(data.data).map(([key, value]) =>
-
 
49
							value.map(err =>
-
 
50
								dispatch(addNotification({
-
 
51
									style: 'danger',
-
 
52
									msg: `${key}: ${err}`
-
 
53
								}))
-
 
54
							)
-
 
55
						)
45
					}))
56
					return
Línea 46... Línea 57...
46
				}
57
				}
47
 
58
 
48
				clearErrors()
59
				clearErrors()