Skip to content

Commit dd66976

Browse files
committed
small changes
1 parent 9b6a47a commit dd66976

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

web/src/components/admin/tenant-org-manager/BulkImportModal.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function BulkImportModal({
3838
const groupIdMap: Record<string, string> = {};
3939
const fetchGroupsIds = async () => {
4040
try {
41-
const res = await fetch(`${API_BASE}/org-manager/${encodeURIComponent(realm)}/groups`, {
41+
const res = await fetch(`${API_BASE}/realms/${encodeURIComponent(realm)}/groups`, {
4242
headers: { Authorization: keycloak.token ? `Bearer ${keycloak.token}` : "" },
4343
});
4444
if (!res.ok) return;
@@ -54,7 +54,7 @@ export function BulkImportModal({
5454
for (const name of groupNames) {
5555
if (groupIdMap[name]) continue;
5656
try {
57-
const res = await fetch(`${API_BASE}/org-manager/${encodeURIComponent(realm)}/groups`, {
57+
const res = await fetch(`${API_BASE}/realms/${encodeURIComponent(realm)}/groups`, {
5858
method: "POST",
5959
headers: {
6060
Authorization: keycloak.token ? `Bearer ${keycloak.token}` : "",
@@ -76,13 +76,14 @@ export function BulkImportModal({
7676
continue;
7777
}
7878
try {
79-
const res = await fetch(`${API_BASE}/org-manager/${encodeURIComponent(realm)}/users`, {
79+
const res = await fetch(`${API_BASE}/realms/users`, {
8080
method: "POST",
8181
headers: {
8282
Authorization: keycloak.token ? `Bearer ${keycloak.token}` : "",
8383
"Content-Type": "application/json",
8484
},
8585
body: JSON.stringify({
86+
realm,
8687
username: u.username,
8788
name: u.name,
8889
email: u.email,
@@ -103,7 +104,7 @@ export function BulkImportModal({
103104

104105
// Assign groups
105106
try {
106-
const res = await fetch(`${API_BASE}/org-manager/${encodeURIComponent(realm)}/users`, {
107+
const res = await fetch(`${API_BASE}/realms/${encodeURIComponent(realm)}/users`, {
107108
headers: { Authorization: keycloak.token ? `Bearer ${keycloak.token}` : "" },
108109
});
109110
if (res.ok) {
@@ -119,7 +120,7 @@ export function BulkImportModal({
119120
const gid = groupIdMap[gName];
120121
if (!gid) continue;
121122
try {
122-
await fetch(`${API_BASE}/org-manager/${encodeURIComponent(realm)}/groups/${encodeURIComponent(gid)}/members/${encodeURIComponent(uid)}`, {
123+
await fetch(`${API_BASE}/realms/${encodeURIComponent(realm)}/groups/${encodeURIComponent(gid)}/members/${encodeURIComponent(uid)}`, {
123124
method: "POST",
124125
headers: { Authorization: keycloak.token ? `Bearer ${keycloak.token}` : "" },
125126
});

web/src/components/admin/tenant-org-manager/NewUserModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ export function NewUserModal({ realm, groups, onClose, onUserCreated }: NewUserM
7474

7575
try {
7676
const res = await fetch(
77-
`${API_BASE}/org-manager/${encodeURIComponent(realm)}/users`,
77+
`${API_BASE}/realms/users`,
7878
{
7979
method: "POST",
8080
headers: {
8181
Authorization: keycloak.token ? `Bearer ${keycloak.token}` : "",
8282
"Content-Type": "application/json",
8383
},
8484
body: JSON.stringify({
85+
realm,
8586
username: newUserUsername || newUserEmail.split("@")[0],
8687
name: newUserName,
8788
email: newUserEmail,

web/src/routes/tenants-org-manager.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function UsersManagement() {
4444
setIsLoading(true);
4545
try {
4646
const res = await fetch(
47-
`${API_BASE}/org-manager/${encodeURIComponent(targetRealm)}/users`,
47+
`${API_BASE}/realms/${encodeURIComponent(targetRealm)}/users`,
4848
{
4949
headers: {
5050
Authorization: keycloak.token ? `Bearer ${keycloak.token}` : "",
@@ -65,7 +65,7 @@ function UsersManagement() {
6565
const fetchGroups = async (targetRealm: string) => {
6666
try {
6767
const res = await fetch(
68-
`${API_BASE}/org-manager/${encodeURIComponent(targetRealm)}/groups`,
68+
`${API_BASE}/realms/${encodeURIComponent(targetRealm)}/groups`,
6969
{
7070
headers: {
7171
Authorization: keycloak.token ? `Bearer ${keycloak.token}` : "",
@@ -96,7 +96,7 @@ function UsersManagement() {
9696
setDeletingIds((prev) => ({ ...prev, [id]: true }));
9797
try {
9898
const res = await fetch(
99-
`${API_BASE}/org-manager/${encodeURIComponent(realm)}/users/${encodeURIComponent(id)}`,
99+
`${API_BASE}/realms/admin/${encodeURIComponent(realm)}/users/${encodeURIComponent(id)}`,
100100
{
101101
method: "DELETE",
102102
headers: {

0 commit comments

Comments
 (0)