add parth admin history
This commit is contained in:
parent
74e64176e6
commit
4b6fd79264
23 changed files with 309 additions and 50 deletions
|
|
@ -56,8 +56,8 @@ export class ProfileTrainingEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{trainingId}")
|
||||
public async trainingHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{trainingId}")
|
||||
public async trainingAdminHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
||||
const _record = await this.trainingRepo.findOneBy({ id: trainingId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(
|
||||
|
|
@ -76,6 +76,17 @@ export class ProfileTrainingEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{trainingId}")
|
||||
public async trainingHistory(@Path() trainingId: string) {
|
||||
const record = await this.trainingHistoryRepo.find({
|
||||
where: {
|
||||
profileTrainingId: trainingId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newTraining(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue