This commit is contained in:
parent
0718f28e5e
commit
e64cd3f384
2 changed files with 121 additions and 68 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue