|
1 | | -import { CrudRequest } from "@dataui/crud"; |
2 | | -import { In } from "typeorm"; |
| 1 | +import { CrudRequest, Override } from "@dataui/crud"; |
| 2 | +import { In, DeepPartial } from "typeorm"; |
3 | 3 | import { BaseEntityModuleOptions, Entity } from "@shared/base-entity/interface"; |
4 | 4 | import { IHeader } from "@shared/utils/exporter/types"; |
5 | 5 | import { AttReportWithReportMonth } from "src/db/view-entities/AttReportWithReportMonth.entity"; |
@@ -70,6 +70,19 @@ function getConfig(): BaseEntityModuleOptions { |
70 | 70 |
|
71 | 71 |
|
72 | 72 | class AttReportWithReportMonthService<T extends Entity | AttReportWithReportMonth> extends BaseEntityService<T> { |
| 73 | + @Override() |
| 74 | + async updateOne(req: CrudRequest<any>, dto: DeepPartial<T>): Promise<T> { |
| 75 | + const attReportService = new BaseEntityService(this.dataSource.getRepository(AttReport), this.mailSendService); |
| 76 | + await attReportService.updateOne(req, dto); |
| 77 | + return this.getOne(req); |
| 78 | + } |
| 79 | + |
| 80 | + @Override() |
| 81 | + async deleteOne(req: CrudRequest<any>): Promise<void | T> { |
| 82 | + const attReportService = new BaseEntityService(this.dataSource.getRepository(AttReport), this.mailSendService); |
| 83 | + return attReportService.deleteOne(req) as Promise<void | T>; |
| 84 | + } |
| 85 | + |
73 | 86 | async doAction(req: CrudRequest<any, any>, body: any): Promise<any> { |
74 | 87 | switch (req.parsed.extra.action) { |
75 | 88 | case 'bulkKnownAbsences': { |
|
0 commit comments