เพิ่มตำแหน่งเลือกได้หลายอัน

This commit is contained in:
Kittapath 2024-04-09 21:59:23 +07:00
parent 68c31be431
commit 166c919bbe
10 changed files with 424 additions and 115 deletions

View file

@ -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();
}
}