Merge branch 'develop-Bright' into develop

This commit is contained in:
harid 2026-03-12 17:56:59 +07:00
commit 24fb2067e5

View file

@ -1925,6 +1925,38 @@ export class DevelopmentController extends Controller {
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 /
*