institucion endpoints restringidos a usuario
This commit is contained in:
@@ -46,7 +46,7 @@ export class CarreraProgramaController {
|
||||
create(@Request() req, @Body() body: CreateCarreraProgramaDto) {
|
||||
const admin: Operador = req.user.operador;
|
||||
|
||||
if (admin.tipoUsuario.id_tipo_usuario != 3)
|
||||
if (!admin || admin.tipoUsuario.id_tipo_usuario != 3)
|
||||
throw new ConflictException('No tienes permiso de realizar esta acción.');
|
||||
return this.carreraProgramaService.create(
|
||||
admin,
|
||||
@@ -69,7 +69,7 @@ export class CarreraProgramaController {
|
||||
delete(@Request() req, @Body() body: DeleteCarreraProgramaDto) {
|
||||
const admin: Operador = req.user.operador;
|
||||
|
||||
if (admin.tipoUsuario.id_tipo_usuario != 3)
|
||||
if (!admin || admin.tipoUsuario.id_tipo_usuario != 3)
|
||||
throw new ConflictException('No tienes permiso de realizar esta acción.');
|
||||
return this.carreraProgramaService.delete(admin, body.id_carrera_programa);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user