diff --git a/src/alokasi-ruangan/alokasi-ruangan.module.ts b/src/alokasi-ruangan/alokasi-ruangan.module.ts index b486a6c8c53b4b3acdcb541106363a3f1ddd399d..874d4733fd314aa13f85ae4c15d44c99ee25ac29 100644 --- a/src/alokasi-ruangan/alokasi-ruangan.module.ts +++ b/src/alokasi-ruangan/alokasi-ruangan.module.ts @@ -3,6 +3,8 @@ import { TypeOrmModule } from "@nestjs/typeorm"; import { AuthModule } from "src/auth/auth.module"; import { DosenBimbingan } from "src/entities/dosenBimbingan.entity"; import { PendaftaranSidsem } from "src/entities/pendaftaranSidsem"; +import { PendaftaranTesis } from "src/entities/pendaftaranTesis.entity"; +import { Pengguna } from "src/entities/pengguna.entity"; import { PengujiSidsem } from "src/entities/pengujiSidsem.entity"; import { CustomStrategy } from "src/middlewares/custom.strategy"; import { AlokasiRuanganController } from "./alokasi-ruangan.controller"; @@ -14,6 +16,8 @@ import { AlokasiRuanganService } from "./alokasi-ruangan.service"; PendaftaranSidsem, PengujiSidsem, DosenBimbingan, + PendaftaranTesis, + Pengguna, ]), AuthModule, ], diff --git a/src/alokasi-ruangan/alokasi-ruangan.service.ts b/src/alokasi-ruangan/alokasi-ruangan.service.ts index fbdfc9bc17aed2cee1e7d2f5bd25a1a8b4e801d2..ea48604280274c003920576632a377a5e618f2b6 100644 --- a/src/alokasi-ruangan/alokasi-ruangan.service.ts +++ b/src/alokasi-ruangan/alokasi-ruangan.service.ts @@ -24,6 +24,7 @@ export class AlokasiRuanganService { private dosenBimbinganRepo: Repository<DosenBimbingan>, ) {} + // TODO only show pendaftaran belom lulus? async findAll( query: GetAllPengajuanSidangReqQueryDto, ): Promise<GetAllPengajuanSidangRespDto> { @@ -34,9 +35,10 @@ export class AlokasiRuanganService { tipe: true, ruangan: true, pendaftaranTesis: { + id: true, mahasiswa: { - nim: true, nama: true, + nim: true, }, }, }, @@ -45,14 +47,14 @@ export class AlokasiRuanganService { mahasiswa: true, }, }, - take: query.limit, - skip: (query.page - 1) * query.limit, + take: query.limit || undefined, + skip: (query.page - 1) * query.limit || undefined, where: { tipe: query.jenisSidang, pendaftaranTesis: { mahasiswa: [ - { nim: Like(`%${query.search}%`) }, - { nama: Like(`%${query.search}%`) }, + { nim: Like(`%${query.search ?? ""}%`) }, + { nama: Like(`%${query.search ?? ""}%`) }, ], }, }, @@ -152,6 +154,7 @@ export class AlokasiRuanganService { return data; } + // TODO bisa set lagi ke null atau tidak? async update( id: string, updateAlokasiRuanganDto: UpdateAlokasiRuanganReqDto, @@ -162,6 +165,7 @@ export class AlokasiRuanganService { waktuMulai: true, tipe: true, pendaftaranTesis: { + id: true, mahasiswa: { nama: true, nim: true,