delete comment
This commit is contained in:
parent
0c7c3361f6
commit
640668decb
3 changed files with 11 additions and 3 deletions
|
|
@ -107,6 +107,14 @@ export class KeycloakController extends Controller {
|
|||
}
|
||||
const list = await getRoles();
|
||||
if (!Array.isArray(list)) throw new Error("Failed. Cannot get role(s) data from the server.");
|
||||
const result = await addUserRoles(
|
||||
userId,
|
||||
list.filter((v) => body.roles.includes(v.id)),
|
||||
);
|
||||
|
||||
if (!result) {
|
||||
throw new Error("Failed. Cannot set user's role.");
|
||||
}
|
||||
const profile = await this.profileRepo.findOne({
|
||||
where: {
|
||||
id: body.profileId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue