แก้api ลูกจ้างประจำ
This commit is contained in:
parent
ab138c2e04
commit
23e5d4f7fe
44 changed files with 7960 additions and 79 deletions
|
|
@ -576,7 +576,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
*/
|
||||
@Post()
|
||||
async createProfile(@Body() body: CreateProfileEmployee, @Request() request: RequestWithUser) {
|
||||
await new permission().PermissionCreate(request,"SYS_REGISTRY_EMP");
|
||||
await new permission().PermissionCreate(request, "SYS_REGISTRY_EMP");
|
||||
if (await this.profileRepo.findOneBy({ citizenId: body.citizenId })) {
|
||||
throw new HttpError(
|
||||
HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
|
|
@ -629,7 +629,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
@Path() id: string,
|
||||
@Body() body: UpdateProfileEmployee,
|
||||
) {
|
||||
await new permission().PermissionUpdate(request,"SYS_REGISTRY_EMP");
|
||||
await new permission().PermissionUpdate(request, "SYS_REGISTRY_EMP");
|
||||
const exists =
|
||||
!!body.citizenId &&
|
||||
(await this.profileRepo.findOne({
|
||||
|
|
@ -692,8 +692,8 @@ export class ProfileEmployeeController extends Controller {
|
|||
* @param {string} id Id ทะเบียนประวัติ
|
||||
*/
|
||||
@Delete("{id}")
|
||||
async deleteProfile(@Path() id: string, @Request() request: RequestWithUser,) {
|
||||
await new permission().PermissionDelete(request,"SYS_REGISTRY_EMP");
|
||||
async deleteProfile(@Path() id: string, @Request() request: RequestWithUser) {
|
||||
await new permission().PermissionDelete(request, "SYS_REGISTRY_EMP");
|
||||
const result = await this.profileRepo.findOne({ where: { id: id } });
|
||||
if (!result) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue