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;
|
||||
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue