@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
This commit is contained in:
kittapath 2024-10-18 10:00:53 +07:00
parent f51adcc8cb
commit ce5c56bfca
33 changed files with 22 additions and 55 deletions

View file

@ -31,7 +31,6 @@ import { setLogDataDiff } from "../interfaces/utils";
HttpStatusCode.INTERNAL_SERVER_ERROR,
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
)
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
export class PosExecutiveController extends Controller {
private posExecutiveRepository = AppDataSource.getRepository(PosExecutive);
private positionRepository = AppDataSource.getRepository(Position);
@ -85,8 +84,8 @@ export class PosExecutiveController extends Controller {
posExecutive.lastUpdateFullName = request.user.name;
posExecutive.createdAt = new Date();
posExecutive.lastUpdatedAt = new Date();
await this.posExecutiveRepository.save(posExecutive, {data: request});
setLogDataDiff(request, {before, after: posExecutive});
await this.posExecutiveRepository.save(posExecutive, { data: request });
setLogDataDiff(request, { before, after: posExecutive });
return new HttpSuccess(posExecutive.id);
}
@ -147,8 +146,8 @@ export class PosExecutiveController extends Controller {
posExecutive.lastUpdateFullName = request.user.name;
posExecutive.lastUpdatedAt = new Date();
// this.posExecutiveRepository.merge(posExecutive, requestBody);
await this.posExecutiveRepository.save(posExecutive, {data: request});
setLogDataDiff(request, {before, after: posExecutive});
await this.posExecutiveRepository.save(posExecutive, { data: request });
setLogDataDiff(request, { before, after: posExecutive });
return new HttpSuccess();
}