eliminado un wip
This commit is contained in:
@@ -362,7 +362,9 @@ public class AdminController: ControllerBase
|
||||
}
|
||||
// lo da de baja si no tiene el grupo propietario y no tiene alquileres pendientes
|
||||
var ret = RepositorioUsuarios.Singleton.BajaCliente(Dni);
|
||||
return Ok(ret);
|
||||
return ret ?
|
||||
Ok(new { message = "Cliente ha sido modificado" }) :
|
||||
BadRequest(new { message = "No se pudo modificar al cliente" });
|
||||
}
|
||||
|
||||
[HttpDelete("api/admin/propiedad")]
|
||||
|
||||
@@ -87,7 +87,6 @@
|
||||
}
|
||||
|
||||
async function bajaCliente(event: Event, cli: Cliente) {
|
||||
//WIP añadir una flag para que muestre que no se pudo dar se alta/baja
|
||||
event.stopPropagation();
|
||||
try {
|
||||
const response = await fetch(
|
||||
@@ -99,13 +98,14 @@
|
||||
},
|
||||
},
|
||||
);
|
||||
if (response.ok) {
|
||||
let data = await response.json();
|
||||
modaldata = data.message;
|
||||
if (response.ok) {
|
||||
cli.habilitado = !cli.habilitado;
|
||||
cargaUsuarios();
|
||||
}
|
||||
} catch {
|
||||
modaldata = "";
|
||||
modaldata = "Fallo al hacer la request";
|
||||
}
|
||||
}
|
||||
async function añadirGrupo(e: Event, cli: Cliente, grupo: string) {
|
||||
|
||||
Reference in New Issue
Block a user