Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 12147 Rev 12164
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: 'danger',
72
						style: 'error',
73
						msg: typeof data.data === 'string' ? data.data : 'Ha ocurrido un error'
73
						msg: '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: 'danger',
84
				style: 'error',
85
				msg: 'Ha ocurrido un error'
85
				msg: 'Ha ocurrido un error'
Línea 86... Línea 86...
86
			})))
86
			})))
Línea 176... Línea 176...
176
							</select>
176
							</select>
177
						</div>
177
						</div>
178
						<div className="form-group">
178
						<div className="form-group">
179
							<label>Último día de aplicación</label>
179
							<label>Último día de aplicación</label>
180
							<Datetime
180
							<Datetime
181
								dateFormat="YYYY-MM-DD"
181
								dateFormat="DD-MM-YYYY"
182
								timeFormat={false}
182
								timeFormat={false}
183
								initialValue={action === 'edit' ? Date.UTC(year) : Date.now()}
183
								initialValue={action === 'edit' ? Date.UTC(year) : Date.now()}
184
								onChange={(e) =>
184
								onChange={(e) =>
185
									setYear(new Intl.DateTimeFormat({ year: 'numeric', month: 'numeric', day: 'numeric' }).format(e.toDate()))
185
									setYear(new Intl.DateTimeFormat({ year: 'numeric', month: 'numeric', day: 'numeric' }).format(e.toDate()))
186
								}
186
								}