Merge branch 'develop' into adiDev
This commit is contained in:
commit
252ecdf6ee
1 changed files with 23 additions and 4 deletions
|
|
@ -78,9 +78,18 @@ export class AuthRoleController extends Controller {
|
|||
|
||||
@Post("govoment")
|
||||
public async AddAuthRoleGovoment(@Request() req: RequestWithUser, @Body() body: CreateAddAuthRole) {
|
||||
const getDetail = await this.authRoleRepo.findOneBy({ id: body.authRoleId });
|
||||
if (!getDetail) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลสิทธิ์");
|
||||
|
||||
let _NULL_ : any = null;
|
||||
let getDetail
|
||||
|
||||
if(body.authRoleId == "") {
|
||||
body.authRoleId = _NULL_
|
||||
}
|
||||
else {
|
||||
getDetail = await this.authRoleRepo.findOneBy({ id: body.authRoleId });
|
||||
if (!getDetail) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลสิทธิ์");
|
||||
}
|
||||
|
||||
const posMaster = await this.posMasterRepository.findOneBy({ id : body.posMasterId })
|
||||
if (!posMaster) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลตำแหน่ง");
|
||||
|
||||
|
|
@ -93,8 +102,18 @@ export class AuthRoleController extends Controller {
|
|||
|
||||
@Post("employee")
|
||||
public async AddAuthRoleEmployee(@Request() req: RequestWithUser, @Body() body: CreateAddAuthRole) {
|
||||
const getDetail = await this.authRoleRepo.findOneBy({ id: body.authRoleId });
|
||||
if (!getDetail) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลสิทธิ์");
|
||||
|
||||
let _NULL_ : any = null;
|
||||
let getDetail
|
||||
|
||||
if(body.authRoleId == "") {
|
||||
body.authRoleId = _NULL_
|
||||
}
|
||||
else {
|
||||
getDetail = await this.authRoleRepo.findOneBy({ id: body.authRoleId });
|
||||
if (!getDetail) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลสิทธิ์");
|
||||
}
|
||||
|
||||
|
||||
const posMaster = await this.employeePosMasterRepository.findOneBy({ id : body.posMasterId })
|
||||
if (!posMaster) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลตำแหน่ง");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue