fix super_admin
This commit is contained in:
parent
cb0a3e2f38
commit
da39fdd48a
2 changed files with 6 additions and 6 deletions
|
|
@ -74,7 +74,7 @@ export class EmployeePositionController extends Controller {
|
||||||
requestBody: CreateEmployeePosDict,
|
requestBody: CreateEmployeePosDict,
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionCreate(request, "SYS_ORG_EMP");
|
// await new permission().PermissionCreate(request, "SYS_ORG_EMP");
|
||||||
const empPosDict = Object.assign(new EmployeePosDict(), requestBody);
|
const empPosDict = Object.assign(new EmployeePosDict(), requestBody);
|
||||||
if (!empPosDict) {
|
if (!empPosDict) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
|
@ -126,7 +126,7 @@ export class EmployeePositionController extends Controller {
|
||||||
requestBody: UpdateEmployeePosDict,
|
requestBody: UpdateEmployeePosDict,
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionUpdate(request, "SYS_ORG_EMP");
|
// await new permission().PermissionUpdate(request, "SYS_ORG_EMP");
|
||||||
const empPosDict = await this.employeePosDictRepository.findOne({
|
const empPosDict = await this.employeePosDictRepository.findOne({
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
});
|
});
|
||||||
|
|
@ -176,7 +176,7 @@ export class EmployeePositionController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Delete("position/{id}")
|
@Delete("position/{id}")
|
||||||
async delete(@Path() id: string, @Request() request: RequestWithUser) {
|
async delete(@Path() id: string, @Request() request: RequestWithUser) {
|
||||||
await new permission().PermissionDelete(request, "SYS_ORG_EMP");
|
// await new permission().PermissionDelete(request, "SYS_ORG_EMP");
|
||||||
const delEmpPosDict = await this.employeePosDictRepository.findOne({ where: { id } });
|
const delEmpPosDict = await this.employeePosDictRepository.findOne({ where: { id } });
|
||||||
if (!delEmpPosDict) {
|
if (!delEmpPosDict) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งลูกจ้างประจำนี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งลูกจ้างประจำนี้");
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ export class PositionController extends Controller {
|
||||||
requestBody: CreatePosDict,
|
requestBody: CreatePosDict,
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionCreate(request, "SYS_ORG");
|
// await new permission().PermissionCreate(request, "SYS_ORG");
|
||||||
const posDict = Object.assign(new PosDict(), requestBody);
|
const posDict = Object.assign(new PosDict(), requestBody);
|
||||||
if (!posDict) {
|
if (!posDict) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
|
@ -274,7 +274,7 @@ export class PositionController extends Controller {
|
||||||
requestBody: UpdatePosDict,
|
requestBody: UpdatePosDict,
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionUpdate(request, "SYS_ORG");
|
// await new permission().PermissionUpdate(request, "SYS_ORG");
|
||||||
const posDict = await this.posDictRepository.findOne({
|
const posDict = await this.posDictRepository.findOne({
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
});
|
});
|
||||||
|
|
@ -355,7 +355,7 @@ export class PositionController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Delete("position/{id}")
|
@Delete("position/{id}")
|
||||||
async delete(@Path() id: string, @Request() request: RequestWithUser) {
|
async delete(@Path() id: string, @Request() request: RequestWithUser) {
|
||||||
await new permission().PermissionDelete(request, "SYS_ORG");
|
// await new permission().PermissionDelete(request, "SYS_ORG");
|
||||||
const delPosDict = await this.posDictRepository.findOne({ where: { id } });
|
const delPosDict = await this.posDictRepository.findOne({ where: { id } });
|
||||||
if (!delPosDict) {
|
if (!delPosDict) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งในสายงานนี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งในสายงานนี้");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue