add path salary position of user
This commit is contained in:
parent
43b6e42389
commit
d88ac804be
2 changed files with 26 additions and 0 deletions
|
|
@ -43,6 +43,19 @@ export class ProfileSalaryController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("position/user")
|
||||
public async getSalaryPositionUser(@Request() request: { user: Record<string, any> }) {
|
||||
const profile = await this.profileRepo.findOneBy({ keycloak: request.user.sub });
|
||||
if (!profile) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||
}
|
||||
const record = await this.salaryRepo.find({
|
||||
where: { profileId: profile.id },
|
||||
order: { order: "ASC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("{profileId}")
|
||||
public async getSalary(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue