add dpis controller

This commit is contained in:
Suphonchai Phoonsawat 2024-10-07 14:53:27 +07:00
parent 497decefe4
commit 4852131651
74 changed files with 606 additions and 336 deletions

View file

@ -60,7 +60,7 @@ export class EducationLevelController extends Controller {
educationLevel.lastUpdateFullName = request.user.name;
educationLevel.lastUpdatedAt = new Date();
await this.educationLevelRepository.save(educationLevel, { data: request });
setLogDataDiff( request, { before, after: educationLevel } );
setLogDataDiff(request, { before, after: educationLevel });
return new HttpSuccess();
}
@ -96,7 +96,7 @@ export class EducationLevelController extends Controller {
educationLevel.lastUpdatedAt = new Date();
this.educationLevelRepository.merge(educationLevel, requestBody);
await this.educationLevelRepository.save(educationLevel, { data: request });
setLogDataDiff( request, { before, after: educationLevel } );
setLogDataDiff(request, { before, after: educationLevel });
return new HttpSuccess();
}
@ -108,14 +108,14 @@ export class EducationLevelController extends Controller {
* @param {string} id Id
*/
@Delete("{id}")
async deleteEducationLevel(@Path() id: string , @Request() request: RequestWithUser) {
async deleteEducationLevel(@Path() id: string, @Request() request: RequestWithUser) {
const delEducationLevel = await this.educationLevelRepository.findOne({
where: { id },
});
if (!delEducationLevel) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระดับการศึกษานี้");
}
await this.educationLevelRepository.remove(delEducationLevel,{ data: request });
await this.educationLevelRepository.remove(delEducationLevel, { data: request });
return new HttpSuccess();
}