Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 10513 Rev 11272
Línea 27... Línea 27...
27
			return onComplete()
27
			return onComplete()
28
		}
28
		}
Línea 29... Línea 29...
29
 
29
 
30
		axios.post(url)
30
		axios.post(url)
31
			.then(({ data }) => {
31
			.then(({ data }) => {
32
				if (data.success) {
-
 
33
					action && dispatch(action())
-
 
34
					onComplete && onComplete()
-
 
35
 
-
 
36
					closeModal()
-
 
37
 
32
				if (!data.success) {
38
					dispatch(addNotification({
33
					dispatch(addNotification({
39
						style: 'success',
34
						style: 'danger',
40
						msg: message ? message : 'Se ha eliminado con exito'
35
						msg: data.data
41
					}))
36
					}))
-
 
37
				}
-
 
38
				action && dispatch(action())
-
 
39
				onComplete && onComplete()
-
 
40
 
-
 
41
				closeModal()
-
 
42
 
-
 
43
				dispatch(addNotification({
-
 
44
					style: 'success',
-
 
45
					msg: message ? message : 'Se ha eliminado con exito'
42
				}
46
				}))
43
			})
47
			})
44
			.catch(() => dispatch(addNotification({
48
			.catch(() => dispatch(addNotification({
45
				style: 'danger',
49
				style: 'danger',
46
				msg: 'Ha ocurrido un error'
50
				msg: 'Ha ocurrido un error'
Línea 61... Línea 65...
61
				<Modal.Footer>
65
				<Modal.Footer>
62
					<Button
66
					<Button
63
						variant="success"
67
						variant="success"
64
						type="submit"
68
						type="submit"
65
					>
69
					>
66
70
67
					</Button>
71
					</Button>
68
					<Button
72
					<Button
69
						variant="danger"
73
						variant="danger"
70
						onClick={closeModal}
74
						onClick={closeModal}
71
					>
75
					>
72
                        No
76
						No
73
					</Button>
77
					</Button>
74
				</Modal.Footer>
78
				</Modal.Footer>
75
			</form>
79
			</form>
76
		</Modal >
80
		</Modal >
77
	)
81
	)