status ช่วยราชการ
This commit is contained in:
parent
00fbe53f17
commit
72bd27c9b0
3 changed files with 1268 additions and 0 deletions
|
|
@ -198,4 +198,23 @@ export class ProfileAssistanceController extends Controller {
|
|||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
@Post("status")
|
||||
public async editStatusProfileAssistance(
|
||||
@Body() body: { status: string; refId: string },
|
||||
@Request() req: RequestWithUser,
|
||||
@Path() assistanceId: string,
|
||||
) {
|
||||
const record = await this.profileAssistanceRepo.findOneBy({ refId: body.refId });
|
||||
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
|
||||
record.status = body.status.trim().toLocaleUpperCase();
|
||||
record.lastUpdateUserId = req.user.sub;
|
||||
record.lastUpdateFullName = req.user.name;
|
||||
record.lastUpdatedAt = new Date();
|
||||
|
||||
this.profileAssistanceRepo.save(record);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,13 @@ export class ProfileAssistance extends EntityBase {
|
|||
})
|
||||
profileId: string;
|
||||
|
||||
@Column({
|
||||
comment: "สถานะ",
|
||||
default: "PENDING",
|
||||
length: 20,
|
||||
})
|
||||
status: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "หน่วยงานที่ให้ช่วยราชการ",
|
||||
|
|
|
|||
1242
src/migration/1743480298636-update_01042512464.ts
Normal file
1242
src/migration/1743480298636-update_01042512464.ts
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue