เพิ่มตำแหน่งเลือกได้หลายอัน
This commit is contained in:
parent
68c31be431
commit
166c919bbe
10 changed files with 424 additions and 115 deletions
|
|
@ -311,7 +311,37 @@ export class DevelopmentScholarshipController extends Controller {
|
|||
? getDevelopment.studyAbroadEndDate
|
||||
: null,
|
||||
totalPeriod: getDevelopment.totalPeriod ? getDevelopment.totalPeriod : null,
|
||||
status: getDevelopment.status ? getDevelopment.status : null,
|
||||
};
|
||||
return new HttpSuccess(formattedData);
|
||||
}
|
||||
|
||||
/**
|
||||
* API เปลี่ยนสถานะ
|
||||
*
|
||||
* @summary DEV_0 - เปลี่ยนสถานะ #
|
||||
*
|
||||
* @param {string} id Id โครงการ
|
||||
* @param {string} status status สถานะ
|
||||
*/
|
||||
@Get("status/{id}/{status}")
|
||||
async ChangeStatusDevelopemtScholarshipById(@Path() id: string, @Path() status: string) {
|
||||
const getDevelopment = await this.developmentScholarshipRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
if (!getDevelopment) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทุนการศึกษา/ฝึกอบรมนี้");
|
||||
}
|
||||
const _status = status.trim().toUpperCase();
|
||||
getDevelopment.status = _status;
|
||||
if (_status == "GRADUATE") {
|
||||
//xxxxxxxxxxxxxxxxxxxบันทึกลงทะเบียน
|
||||
} else if (_status == "NOTGRADUATE") {
|
||||
} else {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบสถานะนี้ในระบบ");
|
||||
}
|
||||
await this.developmentScholarshipRepository.remove(getDevelopment);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue