add admin path ทะเบียนประวัติ

This commit is contained in:
AdisakKanthawilang 2024-09-03 15:08:29 +07:00
parent a7c1b2e6a9
commit 4bfecf7899
12 changed files with 205 additions and 52 deletions

View file

@ -52,12 +52,23 @@ export class ProfileOtherController extends Controller {
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}")
public async otherHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
// const _record = await this.otherRepository.findOneBy({ id: otherId });
// if (_record) {
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
// }
public async otherHistory(@Path() otherId: string,) {
const record = await this.otherHistoryRepository.find({
where: { profileOtherId: otherId },
order: { createdAt: "DESC" },