แก้ create เป็น update เมนูทะเบียนประวัติ
This commit is contained in:
parent
fde5f8d90a
commit
f281ea0bc2
61 changed files with 193 additions and 147 deletions
|
|
@ -136,12 +136,12 @@ export class ProfileDutyController extends Controller {
|
|||
if (!body.profileId) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId");
|
||||
}
|
||||
|
||||
|
||||
const profile = await this.profileRepository.findOneBy({ id: body.profileId });
|
||||
if (!profile) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||
}
|
||||
await new permission().PermissionOrgUserCreate(req, "SYS_REGISTRY_OFFICER", profile.id);//ตส
|
||||
await new permission().PermissionOrgUserUpdate(req, "SYS_REGISTRY_OFFICER", profile.id); //ไม่แน่ใจOFF
|
||||
|
||||
const data = new ProfileDuty();
|
||||
|
||||
|
|
@ -195,7 +195,11 @@ export class ProfileDutyController extends Controller {
|
|||
public async deleteDuty(@Path() dutyId: string, @Request() req: RequestWithUser) {
|
||||
const _record = await this.dutyRepository.findOneBy({ id: dutyId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserDelete(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||
await new permission().PermissionOrgUserDelete(
|
||||
req,
|
||||
"SYS_REGISTRY_OFFICER",
|
||||
_record.profileId,
|
||||
);
|
||||
}
|
||||
await this.dutyHistoryRepository.delete({
|
||||
profileDutyId: dutyId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue