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

@ -66,8 +66,8 @@ export class ProfileSalaryEmployeeTempController extends Controller {
return new HttpSuccess(record);
}
@Get("history/{salaryId}")
public async salaryHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
@Get("admin/history/{salaryId}")
public async salaryAdminHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
const record = await this.salaryHistoryRepo.find({
where: {
@ -78,6 +78,17 @@ export class ProfileSalaryEmployeeTempController extends Controller {
return new HttpSuccess(record);
}
@Get("history/{salaryId}")
public async salaryHistory(@Path() salaryId: string) {
const record = await this.salaryHistoryRepo.find({
where: {
profileSalaryId: salaryId,
},
order: { createdAt: "DESC" },
});
return new HttpSuccess(record);
}
@Post()
public async newSalaryEmployee(
@Request() req: RequestWithUser,