fix: request body

This commit is contained in:
Methapon2001 2024-03-22 16:32:15 +07:00
parent a0887d8b74
commit 808971b5b2
2 changed files with 4 additions and 8 deletions

View file

@ -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) {

View file

@ -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;