no message

This commit is contained in:
Bright 2024-11-22 14:25:04 +07:00
parent 219a9ff104
commit 1d6a590e43

View file

@ -92,7 +92,7 @@ export class KeycloakController extends Controller {
firstName?: string;
lastName?: string;
email?: string;
roles?: string[];
roles: string[];
profileId?: string;
},
) {
@ -105,6 +105,12 @@ export class KeycloakController extends Controller {
if (typeof userId !== "string") {
throw new Error(userId.errorMessage);
}
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)),
);
const now = new Date().toISOString();
const folderData: any = {