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:
Bahaa Zaid
2025-11-10 14:42:24 +02:00
committed by GitHub
parent d8275fe5df
commit b07e2b8666
4 changed files with 13 additions and 4 deletions

View File

@@ -176,7 +176,6 @@ export const ResourcesPolicySelect = ({
(value || []).map(async (id) =>
adminClient.clients.findOnePolicy({
id: clientId,
type: "",
policyId: id,
}),
),

View File

@@ -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,

View File

@@ -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,

View File

@@ -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[]