updated menu & del permission
This commit is contained in:
parent
1768d4cbbb
commit
12885adf17
2 changed files with 34 additions and 7 deletions
|
|
@ -101,6 +101,19 @@ export class AuthRoleController extends Controller {
|
|||
posMaster.lastUpdateFullName = req.user.name;
|
||||
posMaster.authRoleId = body.authRoleId;
|
||||
await this.posMasterRepository.save(posMaster);
|
||||
|
||||
// เช็คว่าถ้ามีค่า current_holderId ให้ลบ key สิทธิ์ใน redis
|
||||
if (posMaster.current_holderId) {
|
||||
const redisClient = await this.redis.createClient({
|
||||
host: REDIS_HOST,
|
||||
port: REDIS_PORT,
|
||||
});
|
||||
redisClient.del("role_" + posMaster.current_holderId, (err: Error, response: Response) => {
|
||||
if (err) throw err;
|
||||
console.log(response);
|
||||
});
|
||||
}
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue