delete comment

This commit is contained in:
kittapath 2024-12-15 20:40:11 +07:00
parent 0c7c3361f6
commit 640668decb
3 changed files with 11 additions and 3 deletions

View file

@ -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,