mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-06 06:49:53 -06:00
Fix Admin Console crash when opening Client'a Authz Permission details (#44061)
Closes #44056 Signed-off-by: Bahaa Zaid <bahaa.zaid@pixelogicmedia.com>
This commit is contained in:
@@ -176,7 +176,6 @@ export const ResourcesPolicySelect = ({
|
||||
(value || []).map(async (id) =>
|
||||
adminClient.clients.findOnePolicy({
|
||||
id: clientId,
|
||||
type: "",
|
||||
policyId: id,
|
||||
}),
|
||||
),
|
||||
|
||||
@@ -81,7 +81,7 @@ export default function PolicyDetails() {
|
||||
async () => {
|
||||
if (policyId) {
|
||||
const result = await Promise.all([
|
||||
adminClient.clients.findOnePolicy({
|
||||
adminClient.clients.findOnePolicyWithType({
|
||||
id: permissionClientId ?? id,
|
||||
type: policyType!,
|
||||
policyId,
|
||||
|
||||
@@ -68,7 +68,7 @@ export const AssignedPolicies = ({
|
||||
if (values && values.length > 0)
|
||||
return Promise.all(
|
||||
values.map((p) =>
|
||||
adminClient.clients.findOnePolicy({
|
||||
adminClient.clients.findOnePolicyWithType({
|
||||
id: permissionClientId,
|
||||
type: p.type!,
|
||||
policyId: p.id,
|
||||
|
||||
@@ -662,7 +662,7 @@ export class Clients extends Resource<{ realm?: string }> {
|
||||
urlParamKeys: ["id", "type"],
|
||||
});
|
||||
|
||||
public findOnePolicy = this.makeRequest<
|
||||
public findOnePolicyWithType = this.makeRequest<
|
||||
{ id: string; type: string; policyId: string },
|
||||
void
|
||||
>({
|
||||
@@ -672,6 +672,16 @@ export class Clients extends Resource<{ realm?: string }> {
|
||||
catchNotFound: true,
|
||||
});
|
||||
|
||||
public findOnePolicy = this.makeRequest<
|
||||
{ id: string; policyId: string },
|
||||
void
|
||||
>({
|
||||
method: "GET",
|
||||
path: "/{id}/authz/resource-server/policy/{policyId}",
|
||||
urlParamKeys: ["id", "policyId"],
|
||||
catchNotFound: true,
|
||||
});
|
||||
|
||||
public listDependentPolicies = this.makeRequest<
|
||||
{ id: string; policyId: string },
|
||||
PolicyRepresentation[]
|
||||
|
||||
Reference in New Issue
Block a user