Merge branch 'develop-Bright' into develop
This commit is contained in:
commit
24fb2067e5
1 changed files with 32 additions and 0 deletions
|
|
@ -1925,6 +1925,38 @@ export class DevelopmentController extends Controller {
|
||||||
return new HttpSuccess({ data: development, total });
|
return new HttpSuccess({ data: development, total });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API ลบรายชื่อผู้ผ่านการอบรม
|
||||||
|
*
|
||||||
|
* @summary ลบรายชื่อผู้ผ่านการอบรม
|
||||||
|
*
|
||||||
|
* @param {string} id Id ผู้ผ่านการอบรม
|
||||||
|
*/
|
||||||
|
@Delete("delete/{id}")
|
||||||
|
async DeleteDevelopmentBy(@Path() id: string, @Request() request: RequestWithUser) {
|
||||||
|
await new permission().PermissionDelete(request, "SYS_DEV_PROJECT");
|
||||||
|
const developmentHis = await this.developmentHistoryRepository.findOne({
|
||||||
|
where: { id },
|
||||||
|
});
|
||||||
|
if (!developmentHis) {
|
||||||
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลรายชื่อผู้ผ่านการอบรม");
|
||||||
|
}
|
||||||
|
if (developmentHis.isProfile) {
|
||||||
|
if (developmentHis.isDone || developmentHis.isDoneIDP) {
|
||||||
|
await new CallAPI()
|
||||||
|
.PostData(request, "/org/profile/training/delete-byId", {
|
||||||
|
type: developmentHis.type,
|
||||||
|
profileId: developmentHis.profileId,
|
||||||
|
developmentId: developmentHis.developmentId,
|
||||||
|
})
|
||||||
|
.then((x) => {})
|
||||||
|
.catch((x) => {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await this.developmentHistoryRepository.delete({ id });
|
||||||
|
return new HttpSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API ลบโครงการ/หลักสูตรการฝึกอบรม
|
* API ลบโครงการ/หลักสูตรการฝึกอบรม
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue