add parth admin history

This commit is contained in:
AdisakKanthawilang 2024-09-09 18:10:01 +07:00
parent 74e64176e6
commit 4b6fd79264
23 changed files with 309 additions and 50 deletions

View file

@ -77,8 +77,8 @@ export class ProfileHonorEmployeeTempController extends Controller {
return new HttpSuccess(record);
}
@Get("history/{honorId}")
public async honorHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
@Get("admin/history/{honorId}")
public async honorAdminHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
const record = await this.honorHistoryRepo.find({
where: {
@ -89,6 +89,17 @@ export class ProfileHonorEmployeeTempController extends Controller {
return new HttpSuccess(record);
}
@Get("history/{honorId}")
public async honorHistory(@Path() honorId: string) {
const record = await this.honorHistoryRepo.find({
where: {
profileHonorId: honorId,
},
order: { createdAt: "DESC" },
});
return new HttpSuccess(record);
}
@Post()
public async newHonor(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeHonor) {
await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");