fix: permission
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m11s

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-05-12 15:14:21 +07:00
parent 0718f28e5e
commit e64cd3f384
2 changed files with 121 additions and 68 deletions

View file

@ -296,6 +296,7 @@ export class PosMasterActController extends Controller {
where: {
id: id,
},
relations: ["posMasterChild", "posMasterChild.current_holder"],
});
try {
result = await this.posMasterActRepository.delete({ id: id });
@ -320,6 +321,22 @@ export class PosMasterActController extends Controller {
await this.posMasterActRepository.save(p);
});
}
// ลบ Redis cache ของคนที่เป็น acting
if (posMasterAct != null && posMasterAct.posMasterChild?.current_holderId) {
const profileId = posMasterAct.posMasterChild.current_holderId;
const redisClient = await this.redis.createClient({
host: REDIS_HOST,
port: REDIS_PORT,
});
const delAsync = promisify(redisClient.del).bind(redisClient);
await delAsync("role_" + profileId);
await delAsync("menu_" + profileId);
redisClient.quit();
}
return new HttpSuccess();
}