เช็ค profiletype

This commit is contained in:
kittapath 2024-08-28 15:22:47 +07:00
parent 501117fae1
commit 48f7c44b9e
3 changed files with 5435 additions and 5017 deletions

10349
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,46 +1,49 @@
{ {
"name": "template", "name": "template",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "src/app.js", "main": "src/app.js",
"scripts": { "scripts": {
"dev": "nodemon", "dev": "nodemon",
"check": "tsc --noEmit", "check": "tsc --noEmit",
"start": "node ./dist/app.js", "start": "node ./dist/app.js",
"format": "prettier --write .", "format": "prettier --write .",
"build": "tsoa spec-and-routes && tsc", "build": "tsoa spec-and-routes && tsc",
"migration:generate": "typeorm-ts-node-commonjs migration:generate -d src/database/data-source.ts", "migration:generate": "typeorm-ts-node-commonjs migration:generate -d src/database/data-source.ts",
"migration:run": "typeorm-ts-node-commonjs migration:run -d src/database/data-source.ts" "migration:run": "typeorm-ts-node-commonjs migration:run -d src/database/data-source.ts"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"@types/cors": "^2.8.17", "@types/cors": "^2.8.17",
"@types/express": "^4.17.21", "@types/express": "^4.17.21",
"@types/node": "^20.11.5", "@types/node": "^20.11.5",
"@types/node-cron": "^3.0.11", "@types/node-cron": "^3.0.11",
"@types/swagger-ui-express": "^4.1.6", "@types/swagger-ui-express": "^4.1.6",
"nodemon": "^3.0.3", "nodemon": "^3.0.3",
"prettier": "^3.2.2", "prettier": "^3.2.2",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "^5.3.3" "typescript": "^5.3.3"
}, },
"dependencies": { "dependencies": {
"@elastic/elasticsearch": "^8.15.0", "@elastic/elasticsearch": "^8.14.0",
"@tsoa/runtime": "^6.0.0", "@nestjs/platform-express": "^10.3.7",
"axios": "^1.6.8", "@tsoa/runtime": "^6.0.0",
"cors": "^2.8.5", "axios": "^1.6.8",
"dotenv": "^16.3.1", "cors": "^2.8.5",
"express": "^4.18.2", "dotenv": "^16.3.1",
"fast-jwt": "^3.3.2", "express": "^4.18.2",
"mysql2": "^3.9.1", "fast-jwt": "^3.3.2",
"node-cron": "^3.0.3", "multer": "^1.4.5-lts.1",
"promise.any": "^2.0.6", "mysql2": "^3.9.1",
"reflect-metadata": "^0.2.1", "node-cron": "^3.0.3",
"swagger-ui-express": "^5.0.0", "promise.any": "^2.0.6",
"tsoa": "^6.0.1", "reflect-metadata": "^0.2.1",
"typeorm": "^0.3.19", "swagger-ui-express": "^5.0.0",
"typeorm-cli": "^1.0.7" "tsoa": "^6.0.1",
} "typeorm": "^0.3.19",
} "typeorm-cli": "^1.0.7",
"xlsx": "^0.18.5"
}
}

View file

@ -500,16 +500,14 @@ export class KpiUserDevelopmentController extends Controller {
if (!getKpiUserDevelopment) { if (!getKpiUserDevelopment) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลพัฒนาตนเองนี้"); throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลพัฒนาตนเองนี้");
} }
if(type.trim().toLocaleUpperCase() == "OFFCIER"){ if(type.trim().toLocaleUpperCase() == "OFFICER"){
await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", getKpiUserDevelopment.kpiUserEvaluation.profileId); await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", getKpiUserDevelopment.kpiUserEvaluation.profileId);
} }else if(type.trim().toLocaleUpperCase() == "EMPLOYEE"){
if(type.trim().toLocaleUpperCase() == "EMPLOYEE"){
await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_EMP", getKpiUserDevelopment.kpiUserEvaluation.profileId); await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_EMP", getKpiUserDevelopment.kpiUserEvaluation.profileId);
} }else if(type.trim().toLocaleUpperCase() == "TEMP"){
if(type.trim().toLocaleUpperCase() == "TEMP"){
await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_TEMP", getKpiUserDevelopment.kpiUserEvaluation.profileId); await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_TEMP", getKpiUserDevelopment.kpiUserEvaluation.profileId);
}else{ }else{
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถเข้าถึงข้อมูลนี้ได้"); throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถเข้าถึงข้อมูลนี้ได้ccc");
} }
const mapKpiUserDevelopment = { const mapKpiUserDevelopment = {