เพิ่ม role=> description
This commit is contained in:
parent
77c7574809
commit
ecaab4fc5c
1 changed files with 15 additions and 14 deletions
|
|
@ -151,15 +151,12 @@ export async function getUserList(first = "", max = "", search = "") {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getUserCount() {
|
export async function getUserCount() {
|
||||||
const res = await fetch(
|
const res = await fetch(`${KC_URL}/admin/realms/${KC_REALM}/users/count`, {
|
||||||
`${KC_URL}/admin/realms/${KC_REALM}/users/count`,
|
headers: {
|
||||||
{
|
authorization: `Bearer ${await getToken()}`,
|
||||||
headers: {
|
|
||||||
"authorization": `Bearer ${await getToken()}`,
|
|
||||||
"content-type": `application/json`,
|
"content-type": `application/json`,
|
||||||
},
|
},
|
||||||
},
|
}).catch((e) => console.log("Keycloak Error: ", e));
|
||||||
).catch((e) => console.log("Keycloak Error: ", e));
|
|
||||||
|
|
||||||
if (!res) return false;
|
if (!res) return false;
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
|
|
@ -283,13 +280,17 @@ export async function getRoles(name?: string) {
|
||||||
const data = (await res.json()) as any;
|
const data = (await res.json()) as any;
|
||||||
|
|
||||||
if (Array.isArray(data)) {
|
if (Array.isArray(data)) {
|
||||||
return data.map((v: Record<string, string>) => ({ id: v.id, name: v.name }));
|
return data.map((v: Record<string, string>) => ({
|
||||||
|
id: v.id,
|
||||||
|
name: v.name,
|
||||||
|
description: v.description,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
// return {
|
||||||
id: data.id,
|
// id: data.id,
|
||||||
name: data.name,
|
// name: data.name,
|
||||||
};
|
// };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue