no message

This commit is contained in:
Kittapath 2024-03-18 14:53:24 +07:00
parent ce7f814061
commit 8afaff0d6b
2 changed files with 12 additions and 6 deletions

View file

@ -407,8 +407,10 @@ export class OrganizationUnauthorizeController extends Controller {
posMasterNoSuffix: item.posMasterNoSuffix,
orgShortName: orgShortName,
position: item.current_holder.position,
posType: item.current_holder.posType.posTypeName,
posLevel: item.current_holder.posLevel.posLevelName,
posType:
item.current_holder.posType == null ? null : item.current_holder.posType.posTypeName,
posLevel:
item.current_holder.posLevel == null ? null : item.current_holder.posLevel.posLevelName,
amount: amount ? amount : null,
rootId: item.orgRootId,
root: item.orgRoot?.orgRootName ? item.orgRoot.orgRootName : null,

View file

@ -159,10 +159,14 @@ export class PositionController extends Controller {
requestBody: CreatePosDictExe,
@Request() request: { user: Record<string, any> },
) {
const posDict = Object.assign(new PosDict(), requestBody);
if (!posDict) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
}
let posDict: any;
posDict.posDictName = requestBody.posDictName;
posDict.posDictField = requestBody.posDictField;
posDict.posTypeId = requestBody.posTypeId;
posDict.posLevelId = requestBody.posLevelId;
posDict.posDictExecutiveField = requestBody.posDictExecutiveField;
posDict.posDictArea = requestBody.posDictArea;
posDict.isSpecial = requestBody.isSpecial;
const checkPosTypeId = await this.posTypeRepository.findOne({
where: { id: posDict.posTypeId },