feat: use role name instead

This commit is contained in:
Methapon2001 2024-04-18 16:47:50 +07:00
parent fb158b2457
commit d49c20e9fa

View file

@ -274,7 +274,7 @@ export class UserController extends Controller {
throw new Error("Cannot create user with keycloak service.");
}
const role = list.find((v) => v.id === body.userRole);
const role = list.find((v) => v.name === body.userRole);
const resultAddRole = role && (await addUserRoles(userId, [role]));