add admin path ทะเบียนประวัติ
This commit is contained in:
parent
a7c1b2e6a9
commit
4bfecf7899
12 changed files with 205 additions and 52 deletions
|
|
@ -66,9 +66,12 @@ export class ProfileInsigniaController extends Controller {
|
|||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{InsigniaId}")
|
||||
public async getInsigniaHistory(@Path() InsigniaId: string, @Request() req: RequestWithUser) {
|
||||
|
||||
@Get("admin/history/{InsigniaId}")
|
||||
public async getInsigniaAdminHistory(
|
||||
@Path() InsigniaId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
const _record = await this.insigniaRepo.findOneBy({ id: InsigniaId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||
|
|
@ -87,6 +90,22 @@ export class ProfileInsigniaController extends Controller {
|
|||
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()
|
||||
public async newInsignia(@Request() req: RequestWithUser, @Body() body: CreateProfileInsignia) {
|
||||
if (!body.profileId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue