Error de los modules
This commit is contained in:
parent
2042135d9e
commit
94b411d549
@ -3,9 +3,10 @@ import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { CarreraController } from './carrera.controller';
|
||||
import { CarreraService } from './carrera.service';
|
||||
import { Carrera } from './entity/carrera.entity';
|
||||
import { InstitucionModule } from '../institucion/institucion.module';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([Carrera])],
|
||||
imports: [TypeOrmModule.forFeature([Carrera]), InstitucionModule],
|
||||
controllers: [CarreraController],
|
||||
providers: [CarreraService],
|
||||
exports: [CarreraService],
|
||||
|
@ -3,20 +3,13 @@ import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { Carrera } from './entity/carrera.entity';
|
||||
import { InstitucionService } from '../institucion/institucion.service';
|
||||
import { Institucion } from 'src/institucion/entity/institucion.entity';
|
||||
|
||||
@Injectable()
|
||||
export class CarreraService {
|
||||
constructor(
|
||||
@InjectRepository(Carrera) private repository: Repository<Carrera>,
|
||||
private institucionService: InstitucionService,
|
||||
) { }
|
||||
|
||||
findAllByIdInstitucion(id_institucion: number) {
|
||||
return this.institucionService
|
||||
.findById(id_institucion)
|
||||
.then((institucion) => this.repository.find({institucion}))
|
||||
}
|
||||
) {}
|
||||
|
||||
findById(id_carrera: number) {
|
||||
return this.repository.findOne({ id_carrera }).then((carrera) => {
|
||||
@ -24,4 +17,12 @@ export class CarreraService {
|
||||
return carrera;
|
||||
});
|
||||
}
|
||||
|
||||
findAllByIdInstitucion(id_institucion: number) {
|
||||
return this.institucionService
|
||||
.findById(id_institucion)
|
||||
.then((institucion) => this.repository.find({institucion}))
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -26,6 +26,10 @@ export class CarritoService {
|
||||
await this.institucionTipoCarritoService.findByIdTipoCarito(
|
||||
id_tipo_carrito,
|
||||
);
|
||||
const carrito = this.repository.findAndCount({ modulo, tipoCarrito })
|
||||
.then((existeCarrito) => {
|
||||
console.log(existeCarrito)
|
||||
})
|
||||
const nuevoCarrito = this.repository.create({
|
||||
modulo,
|
||||
tipoCarrito,
|
||||
|
@ -3,10 +3,12 @@ import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { HoraExcepcionController } from './hora-excepcion.controller';
|
||||
import { HoraExcepcionService } from './hora-excepcion.service';
|
||||
import { HoraExcepcion } from './entity/hora-excepcion.entity';
|
||||
import { InstitucionDiaModule } from '../institucion-dia/institucion-dia.module'
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([HoraExcepcion])],
|
||||
imports: [TypeOrmModule.forFeature([HoraExcepcion]), InstitucionDiaModule],
|
||||
controllers: [HoraExcepcionController],
|
||||
providers: [HoraExcepcionService],
|
||||
exports: [HoraExcepcionService]
|
||||
})
|
||||
export class HoraExcepcionModule {}
|
||||
|
@ -7,8 +7,7 @@ import { InstitucionDiaService } from '../institucion-dia/institucion-dia.servic
|
||||
@Injectable()
|
||||
export class HoraExcepcionService {
|
||||
constructor(
|
||||
@InjectRepository(HoraExcepcion)
|
||||
private repository: Repository<HoraExcepcion>,
|
||||
@InjectRepository(HoraExcepcion) private repository: Repository<HoraExcepcion>,
|
||||
private institucionDiaService: InstitucionDiaService,
|
||||
) { }
|
||||
|
||||
|
@ -10,5 +10,6 @@ import { InstitucionModule } from '../institucion/institucion.module';
|
||||
imports: [TypeOrmModule.forFeature([Dia, InstitucionDia]), InstitucionModule],
|
||||
controllers: [InstitucionDiaController],
|
||||
providers: [InstitucionDiaService],
|
||||
exports: [InstitucionDiaService]
|
||||
})
|
||||
export class InstitucionDiaModule {}
|
||||
|
Loading…
Reference in New Issue
Block a user