diff --git a/src/controllers/ProfileGovernmentController.ts b/src/controllers/ProfileGovernmentController.ts index e46113ca..c0c2ea8b 100644 --- a/src/controllers/ProfileGovernmentController.ts +++ b/src/controllers/ProfileGovernmentController.ts @@ -56,10 +56,7 @@ export class ProfileGovernmentHistoryController extends Controller { } @Post() - public async newFamilyHistory( - @Request() req: RequestWithUser, - @Body() body: CreateProfileGovernment, - ) { + public async newGov(@Request() req: RequestWithUser, @Body() body: CreateProfileGovernment) { if (!body.profileId) { throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId"); } @@ -87,7 +84,7 @@ export class ProfileGovernmentHistoryController extends Controller { } @Patch("{profileId}") - public async editFamilyHistory( + public async editGov( @Request() req: RequestWithUser, @Body() body: UpdateProfileGovernment, @Path() profileId: string, @@ -114,7 +111,7 @@ export class ProfileGovernmentHistoryController extends Controller { } @Delete("{profileId}") - public async deleteGovHistory(@Path() profileId: string) { + public async deleteGov(@Path() profileId: string) { const result = await this.govRepo.delete({ profileId: profileId }); if (result.affected && result.affected <= 0) { diff --git a/src/entities/ProfileGovernment.ts b/src/entities/ProfileGovernment.ts index 41b86b34..05a94621 100644 --- a/src/entities/ProfileGovernment.ts +++ b/src/entities/ProfileGovernment.ts @@ -165,10 +165,10 @@ export class ProfileGovernment extends EntityBase { }) positionEmployeePositionSide: string; } + export type CreateProfileGovernment = { positionId: string | null; profileId: string | null; - profile: Profile | null; posNoId: string | null; ocId: string | null; dateAppoint: Date | null; @@ -193,7 +193,6 @@ export type CreateProfileGovernment = { export type UpdateProfileGovernment = { positionId?: string | null; - profile?: Profile | null; posNoId?: string | null; ocId?: string | null; dateAppoint?: Date | null;