Commit c656cfc8 by Billy Larru

eliminar rol

parent 45960e93
......@@ -117,19 +117,48 @@ function listarRolesPolicias(objParams = {}) {
nodes.container.on("click", ".eliminar", function () {
let data = nodes.datatable.DataTable().row($(this).parents("tr")).data();
mostrarModalEliminacion(data);
});
});
});
}
const mostrarModalEliminacion = (data) => {
let {id, estado} = data;
estado = 0;
swal({
title: 'Está seguro de eliminar el rol?',
text: "",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Sí, eliminar!'
}).then((result) => {
if (result.value) {
ajaxWebService.patch(`${URI_ROL_POLICIA}/${id}`, {estado}).then((response) => {
swal({
type: 'success',
title: '¡Eliminado correctamente!',
showConfirmButton: false,
timer: 1500
});
listarRolesPolicias();
});
});
}
});
}
function listarTipoRoles() {
};
const listarTipoRoles = () => {
ajaxWebService.get(URI_TIPOROL_POLICIA).then((response) => {
let tipoRoles = response.data;
let html = "<option>[SELECCIONE]</option>";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment