add admin path ทะเบียนประวัติ
This commit is contained in:
parent
a7c1b2e6a9
commit
4bfecf7899
12 changed files with 205 additions and 52 deletions
|
|
@ -61,17 +61,34 @@ export class ProfileAbilityController extends Controller {
|
||||||
return new HttpSuccess(getProfileAbilityId);
|
return new HttpSuccess(getProfileAbilityId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("history/{abilityId}")
|
@Get("admin/history/{abilityId}")
|
||||||
public async getProfileAbilityHistory(
|
public async getProfileAbilityAdminHistory(
|
||||||
@Path() abilityId: string,
|
@Path() abilityId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
// const _record = await this.profileAbilityRepo.findOne({
|
|
||||||
// where: { id: abilityId },
|
const _record = await this.profileAbilityRepo.findOne({
|
||||||
// });
|
where: { id: abilityId },
|
||||||
// if (_record) {
|
});
|
||||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
if (_record) {
|
||||||
// }
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
|
}
|
||||||
|
|
||||||
|
const record = await this.profileAbilityHistoryRepo.find({
|
||||||
|
where: { profileAbilityId: abilityId },
|
||||||
|
order: { createdAt: "DESC" },
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!record) {
|
||||||
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
}
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Get("history/{abilityId}")
|
||||||
|
public async getProfileAbilityHistory(
|
||||||
|
@Path() abilityId: string,
|
||||||
|
) {
|
||||||
const record = await this.profileAbilityHistoryRepo.find({
|
const record = await this.profileAbilityHistoryRepo.find({
|
||||||
where: { profileAbilityId: abilityId },
|
where: { profileAbilityId: abilityId },
|
||||||
order: { createdAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
|
|
|
||||||
|
|
@ -65,10 +65,36 @@ export class ProfileAssessmentsController extends Controller {
|
||||||
return new HttpSuccess(getProfileAssessments);
|
return new HttpSuccess(getProfileAssessments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("admin/history/{assessmentId}")
|
||||||
|
public async getProfileAssessmentsAdminHistory(
|
||||||
|
@Path() assessmentId: string,
|
||||||
|
@Request() req: RequestWithUser,
|
||||||
|
) {
|
||||||
|
const _record = await this.profileAssessmentsRepository.findOne({
|
||||||
|
where: {
|
||||||
|
id: assessmentId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (_record) {
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
|
}
|
||||||
|
|
||||||
|
const record = await this.profileAssessmentsHistoryRepository.find({
|
||||||
|
where: {
|
||||||
|
profileAssessmentId: assessmentId,
|
||||||
|
},
|
||||||
|
order: { createdAt: "DESC" },
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!record) {
|
||||||
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
}
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
@Get("history/{assessmentId}")
|
@Get("history/{assessmentId}")
|
||||||
public async getProfileAssessmentsHistory(
|
public async getProfileAssessmentsHistory(
|
||||||
@Path() assessmentId: string,
|
@Path() assessmentId: string,
|
||||||
@Request() req: RequestWithUser,
|
|
||||||
) {
|
) {
|
||||||
const record = await this.profileAssessmentsHistoryRepository.find({
|
const record = await this.profileAssessmentsHistoryRepository.find({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -80,14 +106,6 @@ export class ProfileAssessmentsController extends Controller {
|
||||||
if (!record) {
|
if (!record) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
// const _record = await this.profileAssessmentsRepository.findOne({
|
|
||||||
// where: {
|
|
||||||
// id: assessmentId,
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// if (_record) {
|
|
||||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
|
||||||
// }
|
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,12 +55,23 @@ export class ProfileCertificateController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("admin/history/{certificateId}")
|
||||||
|
public async certificateAdminHistory(@Path() certificateId: string, @Request() req: RequestWithUser) {
|
||||||
|
const _record = await this.certificateRepo.findOneBy({ id: certificateId });
|
||||||
|
if (_record) {
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
|
}
|
||||||
|
const record = await this.certificateHistoryRepo.find({
|
||||||
|
where: {
|
||||||
|
profileCertificateId: certificateId,
|
||||||
|
},
|
||||||
|
order: { createdAt: "DESC" },
|
||||||
|
});
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
@Get("history/{certificateId}")
|
@Get("history/{certificateId}")
|
||||||
public async certificateHistory(@Path() certificateId: string, @Request() req: RequestWithUser) {
|
public async certificateHistory(@Path() certificateId: string) {
|
||||||
// const _record = await this.certificateRepo.findOneBy({ id: certificateId });
|
|
||||||
// if (_record) {
|
|
||||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
|
||||||
// }
|
|
||||||
const record = await this.certificateHistoryRepo.find({
|
const record = await this.certificateHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
profileCertificateId: certificateId,
|
profileCertificateId: certificateId,
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,8 @@ export class ProfileDisciplineController extends Controller {
|
||||||
return new HttpSuccess(lists);
|
return new HttpSuccess(lists);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("history/{disciplineId}")
|
@Get("admin/history/{disciplineId}")
|
||||||
public async disciplineHistory(@Path() disciplineId: string, @Request() req: RequestWithUser) {
|
public async disciplineAdminHistory(@Path() disciplineId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.disciplineRepository.findOneBy({ id: disciplineId });
|
const _record = await this.disciplineRepository.findOneBy({ id: disciplineId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
|
|
@ -78,7 +78,16 @@ export class ProfileDisciplineController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post()
|
@Get("history/{disciplineId}")
|
||||||
|
public async disciplineHistory(@Path() disciplineId: string, @Request() req: RequestWithUser) {
|
||||||
|
const record = await this.disciplineHistoryRepository.find({
|
||||||
|
where: { profileDisciplineId: disciplineId },
|
||||||
|
order: { createdAt: "DESC" },
|
||||||
|
});
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Post()
|
||||||
public async newDiscipline(
|
public async newDiscipline(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Body() body: CreateProfileDiscipline,
|
@Body() body: CreateProfileDiscipline,
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ export class ProfileDutyController extends Controller {
|
||||||
return new HttpSuccess(lists);
|
return new HttpSuccess(lists);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("history/{dutyId}")
|
@Get("admin/history/{dutyId}")
|
||||||
public async dutyHistory(@Path() dutyId: string, @Request() req: RequestWithUser) {
|
public async dutyAdminHistory(@Path() dutyId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.dutyRepository.findOneBy({ id: dutyId });
|
const _record = await this.dutyRepository.findOneBy({ id: dutyId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
|
|
@ -64,6 +64,15 @@ export class ProfileDutyController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("history/{dutyId}")
|
||||||
|
public async dutyHistory(@Path() dutyId: string,) {
|
||||||
|
const record = await this.dutyHistoryRepository.find({
|
||||||
|
where: { profileDutyId: dutyId },
|
||||||
|
order: { createdAt: "DESC" },
|
||||||
|
});
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
@Post()
|
@Post()
|
||||||
public async newDuty(@Request() req: RequestWithUser, @Body() body: CreateProfileDuty) {
|
public async newDuty(@Request() req: RequestWithUser, @Body() body: CreateProfileDuty) {
|
||||||
if (!body.profileId) {
|
if (!body.profileId) {
|
||||||
|
|
|
||||||
|
|
@ -63,15 +63,31 @@ export class ProfileEducationsController extends Controller {
|
||||||
return new HttpSuccess(getProfileEducation);
|
return new HttpSuccess(getProfileEducation);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("history/{educationId}")
|
@Get("admin/history/{educationId}")
|
||||||
public async getProfileEducationHistory(
|
public async getProfileEducationAdminHistory(
|
||||||
@Path() educationId: string,
|
@Path() educationId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
// const _record = await this.profileEducationRepo.findOneBy({ id: educationId });
|
const _record = await this.profileEducationRepo.findOneBy({ id: educationId });
|
||||||
// if (_record) {
|
if (_record) {
|
||||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
// }
|
}
|
||||||
|
const record = await this.profileEducationHistoryRepo.find({
|
||||||
|
where: {
|
||||||
|
profileEducationId: educationId,
|
||||||
|
},
|
||||||
|
order: { createdAt: "DESC" },
|
||||||
|
});
|
||||||
|
if (!record) {
|
||||||
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
}
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Get("history/{educationId}")
|
||||||
|
public async getProfileEducationHistory(
|
||||||
|
@Path() educationId: string,
|
||||||
|
) {
|
||||||
const record = await this.profileEducationHistoryRepo.find({
|
const record = await this.profileEducationHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
profileEducationId: educationId,
|
profileEducationId: educationId,
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,8 @@ export class ProfileHonorController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("history/{honorId}")
|
@Get("admin/history/{honorId}")
|
||||||
public async honorHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
|
public async honorAdminHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.honorRepo.findOneBy({ id: honorId });
|
const _record = await this.honorRepo.findOneBy({ id: honorId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
|
|
@ -88,6 +88,17 @@ export class ProfileHonorController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("history/{honorId}")
|
||||||
|
public async honorHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
|
||||||
|
const record = await this.honorHistoryRepo.find({
|
||||||
|
where: {
|
||||||
|
profileHonorId: honorId,
|
||||||
|
},
|
||||||
|
order: { createdAt: "DESC" },
|
||||||
|
});
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
@Post()
|
@Post()
|
||||||
public async newHonor(@Request() req: RequestWithUser, @Body() body: CreateProfileHonor) {
|
public async newHonor(@Request() req: RequestWithUser, @Body() body: CreateProfileHonor) {
|
||||||
if (!body.profileId) {
|
if (!body.profileId) {
|
||||||
|
|
|
||||||
|
|
@ -66,9 +66,12 @@ export class ProfileInsigniaController extends Controller {
|
||||||
});
|
});
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("history/{InsigniaId}")
|
@Get("admin/history/{InsigniaId}")
|
||||||
public async getInsigniaHistory(@Path() InsigniaId: string, @Request() req: RequestWithUser) {
|
public async getInsigniaAdminHistory(
|
||||||
|
@Path() InsigniaId: string,
|
||||||
|
@Request() req: RequestWithUser,
|
||||||
|
) {
|
||||||
const _record = await this.insigniaRepo.findOneBy({ id: InsigniaId });
|
const _record = await this.insigniaRepo.findOneBy({ id: InsigniaId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
|
|
@ -87,6 +90,22 @@ export class ProfileInsigniaController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("history/{InsigniaId}")
|
||||||
|
public async getInsigniaHistory(@Path() InsigniaId: string) {
|
||||||
|
const record = await this.insigniaHistoryRepo.find({
|
||||||
|
relations: {
|
||||||
|
insignia: {
|
||||||
|
insigniaType: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
profileInsigniaId: InsigniaId,
|
||||||
|
},
|
||||||
|
order: { createdAt: "DESC" },
|
||||||
|
});
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
@Post()
|
@Post()
|
||||||
public async newInsignia(@Request() req: RequestWithUser, @Body() body: CreateProfileInsignia) {
|
public async newInsignia(@Request() req: RequestWithUser, @Body() body: CreateProfileInsignia) {
|
||||||
if (!body.profileId) {
|
if (!body.profileId) {
|
||||||
|
|
|
||||||
|
|
@ -146,8 +146,8 @@ export class ProfileLeaveController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("history/{leaveId}")
|
@Get("admin/history/{leaveId}")
|
||||||
public async leaveHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
public async leaveAdminHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.leaveRepo.findOneBy({ id: leaveId });
|
const _record = await this.leaveRepo.findOneBy({ id: leaveId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
|
|
@ -160,6 +160,16 @@ export class ProfileLeaveController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("history/{leaveId}")
|
||||||
|
public async leaveHistory(@Path() leaveId: string,) {
|
||||||
|
const record = await this.leaveHistoryRepo.find({
|
||||||
|
relations: { leaveType: true },
|
||||||
|
where: { profileLeaveId: leaveId },
|
||||||
|
order: { createdAt: "DESC" },
|
||||||
|
});
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
@Post()
|
@Post()
|
||||||
public async newLeave(@Request() req: RequestWithUser, @Body() body: CreateProfileLeave) {
|
public async newLeave(@Request() req: RequestWithUser, @Body() body: CreateProfileLeave) {
|
||||||
if (!body.profileId) {
|
if (!body.profileId) {
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,23 @@ export class ProfileOtherController extends Controller {
|
||||||
return new HttpSuccess(lists);
|
return new HttpSuccess(lists);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("admin/history/{otherId}")
|
||||||
|
public async otherAdminHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
||||||
|
|
||||||
|
const _record = await this.otherRepository.findOneBy({ id: otherId });
|
||||||
|
console.log(">>>>", _record);
|
||||||
|
if (_record) {
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
|
}
|
||||||
|
const record = await this.otherHistoryRepository.find({
|
||||||
|
where: { profileOtherId: otherId },
|
||||||
|
order: { createdAt: "DESC" },
|
||||||
|
});
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
@Get("history/{otherId}")
|
@Get("history/{otherId}")
|
||||||
public async otherHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
public async otherHistory(@Path() otherId: string,) {
|
||||||
// const _record = await this.otherRepository.findOneBy({ id: otherId });
|
|
||||||
// if (_record) {
|
|
||||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
|
||||||
// }
|
|
||||||
const record = await this.otherHistoryRepository.find({
|
const record = await this.otherHistoryRepository.find({
|
||||||
where: { profileOtherId: otherId },
|
where: { profileOtherId: otherId },
|
||||||
order: { createdAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
|
|
|
||||||
|
|
@ -63,12 +63,23 @@ export class ProfileSalaryController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("admin/history/{salaryId}")
|
||||||
|
public async salaryAdminHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
||||||
|
const _record = await this.salaryRepo.findOneBy({ id: salaryId });
|
||||||
|
if (_record) {
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
|
}
|
||||||
|
const record = await this.salaryHistoryRepo.find({
|
||||||
|
where: {
|
||||||
|
profileSalaryId: salaryId,
|
||||||
|
},
|
||||||
|
order: { createdAt: "DESC" },
|
||||||
|
});
|
||||||
|
return new HttpSuccess(record);
|
||||||
|
}
|
||||||
|
|
||||||
@Get("history/{salaryId}")
|
@Get("history/{salaryId}")
|
||||||
public async salaryHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
public async salaryHistory(@Path() salaryId: string,) {
|
||||||
// const _record = await this.salaryRepo.findOneBy({ id: salaryId });
|
|
||||||
// if (_record) {
|
|
||||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
|
||||||
// }
|
|
||||||
const record = await this.salaryHistoryRepo.find({
|
const record = await this.salaryHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
profileSalaryId: salaryId,
|
profileSalaryId: salaryId,
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,8 @@ export class ProfileTrainingController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("history/{trainingId}")
|
@Get("admin/history/{trainingId}")
|
||||||
public async trainingHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
public async trainingAdminHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.trainingRepo.findOneBy({ id: trainingId });
|
const _record = await this.trainingRepo.findOneBy({ id: trainingId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
|
|
@ -70,6 +70,17 @@ export class ProfileTrainingController extends Controller {
|
||||||
return new HttpSuccess(record);
|
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()
|
@Post()
|
||||||
public async newTraining(@Request() req: RequestWithUser, @Body() body: CreateProfileTraining) {
|
public async newTraining(@Request() req: RequestWithUser, @Body() body: CreateProfileTraining) {
|
||||||
if (!body.profileId) {
|
if (!body.profileId) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue