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);
|
||||
}
|
||||
|
||||
@Get("history/{abilityId}")
|
||||
public async getProfileAbilityHistory(
|
||||
@Get("admin/history/{abilityId}")
|
||||
public async getProfileAbilityAdminHistory(
|
||||
@Path() abilityId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
// const _record = await this.profileAbilityRepo.findOne({
|
||||
// where: { id: abilityId },
|
||||
// });
|
||||
// if (_record) {
|
||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||
// }
|
||||
|
||||
const _record = await this.profileAbilityRepo.findOne({
|
||||
where: { id: abilityId },
|
||||
});
|
||||
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({
|
||||
where: { profileAbilityId: abilityId },
|
||||
order: { createdAt: "DESC" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue