listo prestamo
This commit is contained in:
parent
d1124cc2b9
commit
28c1afa8f7
@ -105,7 +105,7 @@ export class CarreraProgramaService {
|
|||||||
id_institucion: number,
|
id_institucion: number,
|
||||||
) {
|
) {
|
||||||
return this.institucionService
|
return this.institucionService
|
||||||
.findInfoInstitucionById(id_institucion)
|
.findById(id_institucion)
|
||||||
.then(async (institucion) => {
|
.then(async (institucion) => {
|
||||||
// Si es un Operador
|
// Si es un Operador
|
||||||
if (usuarioOperador instanceof Operador) {
|
if (usuarioOperador instanceof Operador) {
|
||||||
|
@ -153,9 +153,7 @@ export class CarritoService {
|
|||||||
}) {
|
}) {
|
||||||
const carritos: Carrito[] = [];
|
const carritos: Carrito[] = [];
|
||||||
const institucion = filtros.id_institucion
|
const institucion = filtros.id_institucion
|
||||||
? await this.institucionService.findInfoInstitucionById(
|
? await this.institucionService.findById(parseInt(filtros.id_institucion))
|
||||||
parseInt(filtros.id_institucion),
|
|
||||||
)
|
|
||||||
: null;
|
: null;
|
||||||
const marca = filtros.id_marca
|
const marca = filtros.id_marca
|
||||||
? await this.marcaService.findById(parseInt(filtros.id_marca), 'c')
|
? await this.marcaService.findById(parseInt(filtros.id_marca), 'c')
|
||||||
|
@ -109,9 +109,7 @@ export class EquipoService {
|
|||||||
? await this.carritoService.findById(parseInt(filtros.id_carrito))
|
? await this.carritoService.findById(parseInt(filtros.id_carrito))
|
||||||
: null;
|
: null;
|
||||||
const institucion = filtros.id_institucion
|
const institucion = filtros.id_institucion
|
||||||
? await this.institucionService.findInfoInstitucionById(
|
? await this.institucionService.findById(parseInt(filtros.id_institucion))
|
||||||
parseInt(filtros.id_institucion),
|
|
||||||
)
|
|
||||||
: null;
|
: null;
|
||||||
const marca = filtros.id_marca
|
const marca = filtros.id_marca
|
||||||
? await this.marcaService.findById(parseInt(filtros.id_marca), 'e')
|
? await this.marcaService.findById(parseInt(filtros.id_marca), 'e')
|
||||||
@ -385,7 +383,7 @@ export class EquipoService {
|
|||||||
numero_inventario: string,
|
numero_inventario: string,
|
||||||
) {
|
) {
|
||||||
return this.institucionService
|
return this.institucionService
|
||||||
.findInfoInstitucionById(id_institucion)
|
.findById(id_institucion)
|
||||||
.then((institucion) =>
|
.then((institucion) =>
|
||||||
this.fullInformacionEquipoView.findOne({
|
this.fullInformacionEquipoView.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
@ -21,7 +21,7 @@ export class InstitucionCarreraService {
|
|||||||
|
|
||||||
findAllByIdInstitucion(id_institucion: number) {
|
findAllByIdInstitucion(id_institucion: number) {
|
||||||
return this.institucionService
|
return this.institucionService
|
||||||
.findInfoInstitucionById(id_institucion)
|
.findById(id_institucion)
|
||||||
.then((institucion) =>
|
.then((institucion) =>
|
||||||
this.institucionCarreraRepository.find({
|
this.institucionCarreraRepository.find({
|
||||||
where: {
|
where: {
|
||||||
@ -53,7 +53,7 @@ export class InstitucionCarreraService {
|
|||||||
: id_carrera;
|
: id_carrera;
|
||||||
const institucion =
|
const institucion =
|
||||||
typeof id_institucion === 'number'
|
typeof id_institucion === 'number'
|
||||||
? await this.institucionService.findInfoInstitucionById(id_institucion)
|
? await this.institucionService.findById(id_institucion)
|
||||||
: id_institucion;
|
: id_institucion;
|
||||||
|
|
||||||
return this.institucionCarreraRepository.findOne({
|
return this.institucionCarreraRepository.findOne({
|
||||||
@ -82,7 +82,7 @@ export class InstitucionCarreraService {
|
|||||||
|
|
||||||
findInstitucionProfesor(id_institucion: number) {
|
findInstitucionProfesor(id_institucion: number) {
|
||||||
return this.institucionService
|
return this.institucionService
|
||||||
.findInfoInstitucionById(id_institucion)
|
.findById(id_institucion)
|
||||||
.then((institucion) =>
|
.then((institucion) =>
|
||||||
this.institucionCarreraRepository.findOne({
|
this.institucionCarreraRepository.findOne({
|
||||||
where: { carrera: { id_carrera: 1 }, institucion },
|
where: { carrera: { id_carrera: 1 }, institucion },
|
||||||
|
@ -22,7 +22,7 @@ export class InstitucionDiaService {
|
|||||||
|
|
||||||
findAllByIdInstitucion(id_institucion: number) {
|
findAllByIdInstitucion(id_institucion: number) {
|
||||||
return this.institucionService
|
return this.institucionService
|
||||||
.findInfoInstitucionById(id_institucion)
|
.findById(id_institucion)
|
||||||
.then((institucion) =>
|
.then((institucion) =>
|
||||||
this.repository.find({
|
this.repository.find({
|
||||||
where: { institucion },
|
where: { institucion },
|
||||||
@ -60,7 +60,7 @@ export class InstitucionDiaService {
|
|||||||
if (ahora.weekday() === 0)
|
if (ahora.weekday() === 0)
|
||||||
throw new ConflictException('No hay servicio los días domingo.');
|
throw new ConflictException('No hay servicio los días domingo.');
|
||||||
return this.institucionService
|
return this.institucionService
|
||||||
.findInfoInstitucionById(id_institucion)
|
.findById(id_institucion)
|
||||||
.then((institucion) =>
|
.then((institucion) =>
|
||||||
this.findByInstitucionDia(institucion, ahora.weekday()),
|
this.findByInstitucionDia(institucion, ahora.weekday()),
|
||||||
);
|
);
|
||||||
|
@ -33,7 +33,7 @@ export class InstitucionInfraccionService {
|
|||||||
})
|
})
|
||||||
.then(async (infraccion) => {
|
.then(async (infraccion) => {
|
||||||
const instituciones =
|
const instituciones =
|
||||||
await this.institucionService.findInfoInstitucionAll();
|
await this.institucionService.findAll();
|
||||||
|
|
||||||
for (let i = 0; i < instituciones.length; i++)
|
for (let i = 0; i < instituciones.length; i++)
|
||||||
await this.institucionInfraccionRepository.save(
|
await this.institucionInfraccionRepository.save(
|
||||||
@ -55,7 +55,7 @@ export class InstitucionInfraccionService {
|
|||||||
|
|
||||||
findAllByIdInstitucion(id_institucion: number) {
|
findAllByIdInstitucion(id_institucion: number) {
|
||||||
return this.institucionService
|
return this.institucionService
|
||||||
.findInfoInstitucionById(id_institucion)
|
.findById(id_institucion)
|
||||||
.then((institucion) =>
|
.then((institucion) =>
|
||||||
this.institucionInfraccionRepository
|
this.institucionInfraccionRepository
|
||||||
.createQueryBuilder('ii')
|
.createQueryBuilder('ii')
|
||||||
|
@ -32,7 +32,7 @@ export class InstitucionProgramaService {
|
|||||||
})
|
})
|
||||||
.then(async (programa) => {
|
.then(async (programa) => {
|
||||||
const instituciones =
|
const instituciones =
|
||||||
await this.institucionService.findInfoInstitucionAll();
|
await this.institucionService.findAll();
|
||||||
|
|
||||||
for (let i = 0; i < instituciones.length; i++)
|
for (let i = 0; i < instituciones.length; i++)
|
||||||
await this.institucionProgramaRepository.save(
|
await this.institucionProgramaRepository.save(
|
||||||
@ -50,9 +50,7 @@ export class InstitucionProgramaService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async findAllByIdInstitucion(id_institucion: number, mostrar = false) {
|
async findAllByIdInstitucion(id_institucion: number, mostrar = false) {
|
||||||
const institucion = await this.institucionService.findInfoInstitucionById(
|
const institucion = await this.institucionService.findById(id_institucion);
|
||||||
id_institucion,
|
|
||||||
);
|
|
||||||
const query = this.institucionProgramaRepository
|
const query = this.institucionProgramaRepository
|
||||||
.createQueryBuilder('ip')
|
.createQueryBuilder('ip')
|
||||||
.innerJoinAndSelect('ip.programa', 'p', 'p.id_programa != 1')
|
.innerJoinAndSelect('ip.programa', 'p', 'p.id_programa != 1')
|
||||||
|
@ -40,7 +40,7 @@ export class InstitucionTipoCarritoService {
|
|||||||
})
|
})
|
||||||
.then(async (tipoCarrito) => {
|
.then(async (tipoCarrito) => {
|
||||||
const instituciones =
|
const instituciones =
|
||||||
await this.institucionService.findInfoInstitucionAll();
|
await this.institucionService.findAll();
|
||||||
|
|
||||||
for (let i = 0; i < instituciones.length; i++)
|
for (let i = 0; i < instituciones.length; i++)
|
||||||
await this.institucionTipoCarritoRepository.save(
|
await this.institucionTipoCarritoRepository.save(
|
||||||
@ -58,9 +58,7 @@ export class InstitucionTipoCarritoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async findAllByIdInstitucion(id_institucion: number, mostrar = false) {
|
async findAllByIdInstitucion(id_institucion: number, mostrar = false) {
|
||||||
const institucion = await this.institucionService.findInfoInstitucionById(
|
const institucion = await this.institucionService.findById(id_institucion);
|
||||||
id_institucion,
|
|
||||||
);
|
|
||||||
const query = this.institucionTipoCarritoRepository
|
const query = this.institucionTipoCarritoRepository
|
||||||
.createQueryBuilder('itc')
|
.createQueryBuilder('itc')
|
||||||
.innerJoinAndSelect(
|
.innerJoinAndSelect(
|
||||||
|
@ -33,8 +33,7 @@ export class InstitucionTipoEntradaService {
|
|||||||
);
|
);
|
||||||
})
|
})
|
||||||
.then(async (tipoEntrada) => {
|
.then(async (tipoEntrada) => {
|
||||||
const instituciones =
|
const instituciones = await this.institucionService.findAll();
|
||||||
await this.institucionService.findInfoInstitucionAll();
|
|
||||||
|
|
||||||
for (let i = 0; i < instituciones.length; i++)
|
for (let i = 0; i < instituciones.length; i++)
|
||||||
await this.institucionTipoEntradaRepository.save(
|
await this.institucionTipoEntradaRepository.save(
|
||||||
@ -54,9 +53,7 @@ export class InstitucionTipoEntradaService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async findAllByIdInstitucion(id_institucion: number, mostrar = false) {
|
async findAllByIdInstitucion(id_institucion: number, mostrar = false) {
|
||||||
const institucion = await this.institucionService.findInfoInstitucionById(
|
const institucion = await this.institucionService.findById(id_institucion);
|
||||||
id_institucion,
|
|
||||||
);
|
|
||||||
const query = await this.institucionTipoEntradaRepository
|
const query = await this.institucionTipoEntradaRepository
|
||||||
.createQueryBuilder('ite')
|
.createQueryBuilder('ite')
|
||||||
.innerJoinAndSelect(
|
.innerJoinAndSelect(
|
||||||
|
@ -42,7 +42,7 @@ export class InstitucionController {
|
|||||||
description: 'Endpoint que retorna todas las instituciones activas.',
|
description: 'Endpoint que retorna todas las instituciones activas.',
|
||||||
})
|
})
|
||||||
activas() {
|
activas() {
|
||||||
return this.institucionService.findMinInfoInstitucionAll(true);
|
return this.institucionService.findMinInfoAll(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serealize(InstitucionMinOutputDto)
|
@Serealize(InstitucionMinOutputDto)
|
||||||
@ -56,7 +56,7 @@ export class InstitucionController {
|
|||||||
const superAdmin: Operador = req.user.operador;
|
const superAdmin: Operador = req.user.operador;
|
||||||
|
|
||||||
this.validarUsuarioService.validarSuperAdmin(superAdmin);
|
this.validarUsuarioService.validarSuperAdmin(superAdmin);
|
||||||
return this.institucionService.findMinInfoInstitucionAll();
|
return this.institucionService.findMinInfoAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serealize(InstitucionOutputDto)
|
@Serealize(InstitucionOutputDto)
|
||||||
@ -76,7 +76,7 @@ export class InstitucionController {
|
|||||||
|
|
||||||
this.validarUsuarioService.validarSuperAdminAdmin(admin);
|
this.validarUsuarioService.validarSuperAdminAdmin(admin);
|
||||||
return this.institucionService
|
return this.institucionService
|
||||||
.findById(parseInt(query.id_institucion))
|
.findFullInfoById(parseInt(query.id_institucion))
|
||||||
.then((institucion) => {
|
.then((institucion) => {
|
||||||
if (
|
if (
|
||||||
admin.tipoUsuario.id_tipo_usuario === 3 &&
|
admin.tipoUsuario.id_tipo_usuario === 3 &&
|
||||||
@ -100,7 +100,7 @@ export class InstitucionController {
|
|||||||
const superAdmin: Operador = req.user.operador;
|
const superAdmin: Operador = req.user.operador;
|
||||||
|
|
||||||
this.validarUsuarioService.validarSuperAdmin(superAdmin);
|
this.validarUsuarioService.validarSuperAdmin(superAdmin);
|
||||||
return this.institucionService.findMinInfoInstitucionAll(false, true);
|
return this.institucionService.findMinInfoAll(false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serealize(MessageOutputDto)
|
@Serealize(MessageOutputDto)
|
||||||
|
@ -18,17 +18,11 @@ export class InstitucionService {
|
|||||||
return this.repository.create({ id_institucion });
|
return this.repository.create({ id_institucion });
|
||||||
}
|
}
|
||||||
|
|
||||||
findById(id_institucion: number) {
|
findAll() {
|
||||||
return this.repository
|
return this.repository.find({ select: ['id_institucion'] });
|
||||||
.findOne({ where: { id_institucion } })
|
|
||||||
.then((institucion) => {
|
|
||||||
if (!institucion)
|
|
||||||
throw new NotFoundException('No existe este id institución.');
|
|
||||||
return institucion;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
findInfoInstitucionById(id_institucion: number) {
|
findById(id_institucion: number) {
|
||||||
return this.repository
|
return this.repository
|
||||||
.findOne({ select: ['id_institucion'], where: { id_institucion } })
|
.findOne({ select: ['id_institucion'], where: { id_institucion } })
|
||||||
.then((institucion) => {
|
.then((institucion) => {
|
||||||
@ -38,11 +32,17 @@ export class InstitucionService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
findInfoInstitucionAll() {
|
findFullInfoById(id_institucion: number) {
|
||||||
return this.repository.find({ select: ['id_institucion'] });
|
return this.repository
|
||||||
|
.findOne({ where: { id_institucion } })
|
||||||
|
.then((institucion) => {
|
||||||
|
if (!institucion)
|
||||||
|
throw new NotFoundException('No existe este id institución.');
|
||||||
|
return institucion;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
findMinInfoInstitucionAll(activo = false, responsable = false) {
|
findMinInfoAll(activo = false, responsable = false) {
|
||||||
const busqueda: FindOptionsWhere<Institucion> = {};
|
const busqueda: FindOptionsWhere<Institucion> = {};
|
||||||
|
|
||||||
if (activo) busqueda.activo = activo;
|
if (activo) busqueda.activo = activo;
|
||||||
@ -62,7 +62,7 @@ export class InstitucionService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update(admin: Operador, attrs: Partial<Institucion>) {
|
update(admin: Operador, attrs: Partial<Institucion>) {
|
||||||
return this.findInfoInstitucionById(attrs.id_institucion)
|
return this.findById(attrs.id_institucion)
|
||||||
.then((institucion) => {
|
.then((institucion) => {
|
||||||
if (
|
if (
|
||||||
admin.tipoUsuario.id_tipo_usuario === 3 &&
|
admin.tipoUsuario.id_tipo_usuario === 3 &&
|
||||||
@ -74,8 +74,6 @@ export class InstitucionService {
|
|||||||
Object.assign(institucion, attrs);
|
Object.assign(institucion, attrs);
|
||||||
return this.repository.save(institucion);
|
return this.repository.save(institucion);
|
||||||
})
|
})
|
||||||
.then((_) => ({
|
.then((_) => ({ message: 'Se guardaron los cambios correctamente.' }));
|
||||||
message: 'Se guardaron los cambios correctamente.',
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ export class ModuloService {
|
|||||||
|
|
||||||
async findMinInfoModuloAll(id_institucion: number, activo = 0) {
|
async findMinInfoModuloAll(id_institucion: number, activo = 0) {
|
||||||
return this.institucionService
|
return this.institucionService
|
||||||
.findInfoInstitucionById(id_institucion)
|
.findById(id_institucion)
|
||||||
.then((institucion) => {
|
.then((institucion) => {
|
||||||
const busqueda: FindOptionsWhere<MinInformacionModuloView> = {
|
const busqueda: FindOptionsWhere<MinInformacionModuloView> = {
|
||||||
id_institucion: institucion.id_institucion,
|
id_institucion: institucion.id_institucion,
|
||||||
|
@ -135,9 +135,7 @@ export class MultaService {
|
|||||||
usuario?: string;
|
usuario?: string;
|
||||||
}) {
|
}) {
|
||||||
const institucion = filtros.id_institucion
|
const institucion = filtros.id_institucion
|
||||||
? await this.institucionService.findInfoInstitucionById(
|
? await this.institucionService.findById(parseInt(filtros.id_institucion))
|
||||||
parseInt(filtros.id_institucion),
|
|
||||||
)
|
|
||||||
: null;
|
: null;
|
||||||
const busqueda: FindOptionsWhere<FullInformacionMultaView> = {};
|
const busqueda: FindOptionsWhere<FullInformacionMultaView> = {};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ export class OperadorService {
|
|||||||
) {
|
) {
|
||||||
const institucion =
|
const institucion =
|
||||||
typeof id_institucion === 'number'
|
typeof id_institucion === 'number'
|
||||||
? await this.institucionService.findInfoInstitucionById(id_institucion)
|
? await this.institucionService.findById(id_institucion)
|
||||||
: id_institucion;
|
: id_institucion;
|
||||||
const tipoUsuario = await this.tipoUsuarioService.findById(id_tipo_usuario);
|
const tipoUsuario = await this.tipoUsuarioService.findById(id_tipo_usuario);
|
||||||
|
|
||||||
@ -111,9 +111,7 @@ export class OperadorService {
|
|||||||
operador?: string;
|
operador?: string;
|
||||||
}) {
|
}) {
|
||||||
const institucion = filtros.id_institucion
|
const institucion = filtros.id_institucion
|
||||||
? await this.institucionService.findInfoInstitucionById(
|
? await this.institucionService.findById(parseInt(filtros.id_institucion))
|
||||||
parseInt(filtros.id_institucion),
|
|
||||||
)
|
|
||||||
: null;
|
: null;
|
||||||
const tipoUsuario = filtros.id_tipo_usuario
|
const tipoUsuario = filtros.id_tipo_usuario
|
||||||
? await this.tipoUsuarioService.findById(
|
? await this.tipoUsuarioService.findById(
|
||||||
|
@ -446,9 +446,7 @@ export class PrestamoService {
|
|||||||
usuario?: string;
|
usuario?: string;
|
||||||
}) {
|
}) {
|
||||||
const institucion = filtros.id_institucion
|
const institucion = filtros.id_institucion
|
||||||
? await this.institucionService.findInfoInstitucionById(
|
? await this.institucionService.findById(parseInt(filtros.id_institucion))
|
||||||
parseInt(filtros.id_institucion),
|
|
||||||
)
|
|
||||||
: null;
|
: null;
|
||||||
const modulo = filtros.id_modulo
|
const modulo = filtros.id_modulo
|
||||||
? await this.moduloService.findInfoModuloById(parseInt(filtros.id_modulo))
|
? await this.moduloService.findInfoModuloById(parseInt(filtros.id_modulo))
|
||||||
@ -694,7 +692,7 @@ export class PrestamoService {
|
|||||||
numero_inventario: string,
|
numero_inventario: string,
|
||||||
) {
|
) {
|
||||||
return this.institucionService
|
return this.institucionService
|
||||||
.findInfoInstitucionById(id_institucion)
|
.findById(id_institucion)
|
||||||
.then((institucion) =>
|
.then((institucion) =>
|
||||||
this.equipoService.findByNumeroInventario(
|
this.equipoService.findByNumeroInventario(
|
||||||
institucion,
|
institucion,
|
||||||
|
@ -45,9 +45,7 @@ export class UploadFileService {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
async createEquipos(path: string, id_institucion: number) {
|
async createEquipos(path: string, id_institucion: number) {
|
||||||
const institucion = await this.institucionService.findInfoInstitucionById(
|
const institucion = await this.institucionService.findById(id_institucion);
|
||||||
id_institucion,
|
|
||||||
);
|
|
||||||
let errores: string[] = [];
|
let errores: string[] = [];
|
||||||
let mensajes: string[] = [];
|
let mensajes: string[] = [];
|
||||||
let equiposNuevos: Equipo[] = [];
|
let equiposNuevos: Equipo[] = [];
|
||||||
@ -81,9 +79,7 @@ export class UploadFileService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createUsuarios(path: string, id_institucion: number) {
|
async createUsuarios(path: string, id_institucion: number) {
|
||||||
const institucion = await this.institucionService.findInfoInstitucionById(
|
const institucion = await this.institucionService.findById(id_institucion);
|
||||||
id_institucion,
|
|
||||||
);
|
|
||||||
let errores: string[] = [];
|
let errores: string[] = [];
|
||||||
let mensajes: string[] = [];
|
let mensajes: string[] = [];
|
||||||
let usuariosNuevos: InstitucionUsuario[] = [];
|
let usuariosNuevos: InstitucionUsuario[] = [];
|
||||||
@ -484,9 +480,7 @@ export class UploadFileService {
|
|||||||
|
|
||||||
async uploadLogo(file: Express.Multer.File, id_institucion: number) {
|
async uploadLogo(file: Express.Multer.File, id_institucion: number) {
|
||||||
const path = file ? `${file.destination}/${file.filename}` : null;
|
const path = file ? `${file.destination}/${file.filename}` : null;
|
||||||
const institucion = await this.institucionService.findInfoInstitucionById(
|
const institucion = await this.institucionService.findById(id_institucion);
|
||||||
id_institucion,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!file) throw new BadRequestException('No se mandó ningún logo.');
|
if (!file) throw new BadRequestException('No se mandó ningún logo.');
|
||||||
institucion.logo = path;
|
institucion.logo = path;
|
||||||
|
@ -72,9 +72,7 @@ export class UsuarioService {
|
|||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
const institucion = filtros.id_institucion
|
const institucion = filtros.id_institucion
|
||||||
? await this.institucionService.findInfoInstitucionById(
|
? await this.institucionService.findById(parseInt(filtros.id_institucion))
|
||||||
parseInt(filtros.id_institucion),
|
|
||||||
)
|
|
||||||
: null;
|
: null;
|
||||||
const tipoUsuario = filtros.id_tipo_usuario
|
const tipoUsuario = filtros.id_tipo_usuario
|
||||||
? await this.tipoUsuarioService.findById(
|
? await this.tipoUsuarioService.findById(
|
||||||
|
Loading…
Reference in New Issue
Block a user