add admin path ทะเบียนประวัติ
This commit is contained in:
parent
a7c1b2e6a9
commit
4bfecf7899
12 changed files with 205 additions and 52 deletions
|
|
@ -65,10 +65,36 @@ export class ProfileAssessmentsController extends Controller {
|
|||
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}")
|
||||
public async getProfileAssessmentsHistory(
|
||||
@Path() assessmentId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
const record = await this.profileAssessmentsHistoryRepository.find({
|
||||
where: {
|
||||
|
|
@ -80,14 +106,6 @@ export class ProfileAssessmentsController extends Controller {
|
|||
if (!record) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue