Skip to content

Commit aab3f82

Browse files
fix: workload acl for members
1 parent f18b369 commit aab3f82

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/pages/network-policies/create-edit/NetworkPoliciesIngressCreateEditPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
useCreateNetpolMutation,
88
useDeleteNetpolMutation,
99
useEditNetpolMutation,
10-
useGetAllAplWorkloadsQuery,
10+
useGetAllAplWorkloadNamesQuery,
1111
useGetNetpolQuery,
1212
} from 'redux/otomiApi'
1313
import { FormProvider, Resolver, useFieldArray, useForm } from 'react-hook-form'
@@ -79,7 +79,7 @@ export default function NetworkPoliciesIngressCreateEditPage({
7979
{ teamId, netpolName: networkPolicyName },
8080
{ skip: !networkPolicyName },
8181
)
82-
const { data: aplWorkloads, isLoading: isLoadingAplWorkloads } = useGetAllAplWorkloadsQuery()
82+
const { data: aplWorkloads, isLoading: isLoadingAplWorkloads } = useGetAllAplWorkloadNamesQuery()
8383

8484
// When editing, reset form with fetched data
8585
useEffect(() => {

src/redux/otomiApi.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,9 @@ const injectedRtkApi = api.injectEndpoints({
490490
getAllAplWorkloads: build.query<GetAllAplWorkloadsApiResponse, GetAllAplWorkloadsApiArg>({
491491
query: () => ({ url: `/v2/workloads` }),
492492
}),
493+
getAllAplWorkloadNames: build.query<GetAllAplWorkloadNamesApiResponse, GetAllAplWorkloadNamesApiArg>({
494+
query: () => ({ url: `/v2/workloadNames` }),
495+
}),
493496
getTeamAplWorkloads: build.query<GetTeamAplWorkloadsApiResponse, GetTeamAplWorkloadsApiArg>({
494497
query: (queryArg) => ({ url: `/v2/teams/${queryArg.teamId}/workloads` }),
495498
}),
@@ -6840,6 +6843,15 @@ export type GetAllAplWorkloadsApiResponse = /** status 200 Successfully obtained
68406843
}
68416844
})[]
68426845
export type GetAllAplWorkloadsApiArg = void
6846+
export type GetAllAplWorkloadNamesApiResponse = /** status 200 Successfully obtained all workload names */ {
6847+
metadata?: {
6848+
labels?: {
6849+
[key: string]: string
6850+
}
6851+
name?: string
6852+
}
6853+
}[]
6854+
export type GetAllAplWorkloadNamesApiArg = void
68436855
export type GetTeamAplWorkloadsApiResponse = /** status 200 Successfully obtained team workloads configuration */ ({
68446856
kind: 'AplTeamWorkload'
68456857
spec: {
@@ -8001,6 +8013,7 @@ export const {
80018013
useGetWorkloadValuesQuery,
80028014
useEditWorkloadValuesMutation,
80038015
useGetAllAplWorkloadsQuery,
8016+
useGetAllAplWorkloadNamesQuery,
80048017
useGetTeamAplWorkloadsQuery,
80058018
useCreateAplWorkloadMutation,
80068019
useDeleteAplWorkloadMutation,

0 commit comments

Comments
 (0)