download kk1

This commit is contained in:
kittapath 2024-11-15 09:29:24 +07:00
parent 0e0cfda81c
commit 4880522497
3 changed files with 10 additions and 34 deletions

View file

@ -140,7 +140,7 @@ export class ProfileEmployeeTempController extends Controller {
});
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_TEMP");
if (_workflow == false)
if (_workflow == false && req.user.sub != profile.keycloak)
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_TEMP", profile.id);
let ImgUrl: any;
if (profile?.avatar != null && profile?.avatarName != null) {
@ -307,13 +307,8 @@ export class ProfileEmployeeTempController extends Controller {
},
where: { id: id },
});
if (profiles) {
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_TEMP");
if (_workflow == false)
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_TEMP", profiles.id);
}
if (!profiles) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
let ImgUrl: any;
let ImgUrl: any = null;
let _ImgUrl: any = [];
if (profiles?.avatar != null && profiles?.avatarName != null) {
// await new CallAPI()
@ -322,6 +317,7 @@ export class ProfileEmployeeTempController extends Controller {
// ImgUrl = x.downloadUrl;
// })
// .catch();
let req_: any = req;
const token_ = "Bearer " + req_.headers.authorization.replace("Bearer ", "");