Compare commits
3 Commits
70e1e2d7bf
...
645c4ed6c1
| Author | SHA1 | Date | |
|---|---|---|---|
| 645c4ed6c1 | |||
| 4bd78578a7 | |||
| 5f5295dcb4 |
+5
-1
@@ -86,6 +86,10 @@ import { Costo } from './costo/entities/costo.entity';
|
||||
Costo,
|
||||
],
|
||||
synchronize: false, //Never change to true in production!
|
||||
|
||||
extra: {
|
||||
connectionLimit: 10,
|
||||
},
|
||||
}),
|
||||
}),
|
||||
UserModule,
|
||||
@@ -113,5 +117,5 @@ import { Costo } from './costo/entities/costo.entity';
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
})
|
||||
export class AppModule {}
|
||||
export class AppModule { }
|
||||
//IO
|
||||
|
||||
@@ -13,8 +13,8 @@ export class ProgramaEquipoController {
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR)
|
||||
@Get('programas/:id')
|
||||
findAllProgramByNumber(@Param('id') id: number) {
|
||||
return this.programaEquipoService.findAllProgramByNumber(+id);
|
||||
async findAllProgramByNumber(@Param('id') id: number) {
|
||||
return await this.programaEquipoService.findAllProgramByNumber(+id);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@@ -28,7 +28,7 @@ export class ProgramaEquipoController {
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR)
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
findOne(@Param('id') id: number) {
|
||||
return this.programaEquipoService.findOne(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ export class ProgramaEquipoService {
|
||||
return this.programaEquipoRepository.find();
|
||||
}
|
||||
|
||||
async findOne(ubicacion: string) {
|
||||
async findOne(id_equipo: number) {
|
||||
const equipo = await this.programaEquipoRepository.find({
|
||||
where: { equipo: { ubicacion } },
|
||||
where: { equipo: { id_equipo } },
|
||||
});
|
||||
|
||||
if (equipo.length === 0) {
|
||||
|
||||
@@ -37,7 +37,7 @@ export class UserController {
|
||||
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR)
|
||||
@Get('/perfil')
|
||||
@Get('/perfil')
|
||||
async getAllPerfil() {
|
||||
return this.userService.getAllPerfil();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user