no message
This commit is contained in:
parent
ede2e91be6
commit
7b67c6f63e
1 changed files with 5 additions and 1 deletions
|
|
@ -619,6 +619,10 @@ export class PositionController extends Controller {
|
||||||
posMaster.lastUpdateFullName = request.user.name;
|
posMaster.lastUpdateFullName = request.user.name;
|
||||||
await this.posMasterRepository.save(posMaster);
|
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 });
|
await this.positionRepository.delete({ posMasterId: posMaster.id });
|
||||||
requestBody.positions.forEach(async (x: any) => {
|
requestBody.positions.forEach(async (x: any) => {
|
||||||
const position = Object.assign(new Position());
|
const position = Object.assign(new Position());
|
||||||
|
|
@ -651,13 +655,13 @@ export class PositionController extends Controller {
|
||||||
try {
|
try {
|
||||||
const posMaster = await this.posMasterRepository.findOne({
|
const posMaster = await this.posMasterRepository.findOne({
|
||||||
where: { id },
|
where: { id },
|
||||||
// relations: ["posType", "posLevel", "posExecutive"],
|
|
||||||
});
|
});
|
||||||
if (!posMaster) {
|
if (!posMaster) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
}
|
||||||
const positions = await this.positionRepository.find({
|
const positions = await this.positionRepository.find({
|
||||||
where: { posMasterId: posMaster.id },
|
where: { posMasterId: posMaster.id },
|
||||||
|
relations: ["posType", "posLevel", "posExecutive"],
|
||||||
});
|
});
|
||||||
const formattedData = {
|
const formattedData = {
|
||||||
id: posMaster.id,
|
id: posMaster.id,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue