Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
feat: extend more
Browse files Browse the repository at this point in the history
  • Loading branch information
NotHydra committed Feb 9, 2024
1 parent 7b1cdca commit 277e053
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/api/src/model/extend.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BaseService } from "./base.service";
import { PrismaService } from "../provider/prisma.service";

interface ExtendInterface {
[key: string]: ExtendInterface | boolean;
[key: string]: { include: ExtendInterface } | boolean;
}

export class ExtendService<ModelType, ModelCreateDTO, ModelUpdateDTO> extends BaseService<
Expand Down
6 changes: 5 additions & 1 deletion apps/api/src/model/report/report.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export class ReportService
implements ReportServiceInterface
{
constructor(prismaService: PrismaService) {
super(ReportService.name, prismaService, { user: true, feedback: true });
super(ReportService.name, prismaService, {
trashBin: true,
user: true,
feedback: true,
});
}

public async findNIK(nik: string): Promise<ReportModel[]> {
Expand Down
5 changes: 4 additions & 1 deletion apps/api/src/model/trash-bin/trash-bin.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export class TrashBinService
implements TrashBinServiceInterface
{
constructor(prismaService: PrismaService) {
super(TrashBinService.name, prismaService, { subTrashBin: { include: { trash: true, history: true } } });
super(TrashBinService.name, prismaService, {
subTrashBin: { include: { trash: true, history: true } },
report: true,
});
}

public async increaseOpenCount(id: number): Promise<TrashBinModel> {
Expand Down

0 comments on commit 277e053

Please sign in to comment.