edit permission

This commit is contained in:
DESKTOP-2S5P7D1\Windows 10 2024-12-14 01:04:18 +07:00
parent 4529ac4f9c
commit 3e576ef937

View file

@ -184,7 +184,7 @@ class CheckAuth {
});
}
public async checkOrg(token: any,keycloakId: string) {
public async checkOrg(token: any, keycloakId: string) {
const redisClient = await this.redis.createClient({
host: process.env.REDIS_HOST,
port: process.env.REDIS_PORT,
@ -195,14 +195,15 @@ class CheckAuth {
reply = JSON.parse(reply);
} else {
try {
if (!keycloakId) throw "Error calling API No KeycloakId";
const x = await new CallAPI().GetData(
{
headers: { authorization: token },
},
`/org/permission/checkOrg/${keycloakId}`,
false
},
`/org/permission/checkOrg/${keycloakId}`,
false,
);
const data = {
orgRootId: x.orgRootId,
orgChild1Id: x.orgChild1Id,
@ -210,7 +211,7 @@ class CheckAuth {
orgChild3Id: x.orgChild3Id,
orgChild4Id: x.orgChild4Id,
};
return data;
} catch (error) {
console.error("Error calling API:", error);