no message

This commit is contained in:
Kittapath 2024-02-01 15:44:32 +07:00
parent ede2e91be6
commit 7b67c6f63e

View file

@ -619,6 +619,10 @@ export class PositionController extends Controller {
posMaster.lastUpdateFullName = request.user.name;
await this.posMasterRepository.save(posMaster);
const positions = await this.positionRepository.find({
where: [{ posMasterId: posMaster.id }],
});
await this.positionRepository.remove(positions);
await this.positionRepository.delete({ posMasterId: posMaster.id });
requestBody.positions.forEach(async (x: any) => {
const position = Object.assign(new Position());
@ -651,13 +655,13 @@ export class PositionController extends Controller {
try {
const posMaster = await this.posMasterRepository.findOne({
where: { id },
// relations: ["posType", "posLevel", "posExecutive"],
});
if (!posMaster) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
}
const positions = await this.positionRepository.find({
where: { posMasterId: posMaster.id },
relations: ["posType", "posLevel", "posExecutive"],
});
const formattedData = {
id: posMaster.id,