Parcourir la source

use updated list namespaces endpoint on frontend

Anukul Sangwan il y a 4 ans
Parent
commit
e728be3f60

+ 3 - 2
dashboard/src/main/home/cluster-dashboard/NamespaceSelector.tsx

@@ -29,10 +29,11 @@ export default class NamespaceSelector extends Component<PropsType, StateType> {
     api
       .getNamespaces(
         "<token>",
+        {},
         {
+          id: currentProject.id,
           cluster_id: currentCluster.id,
-        },
-        { id: currentProject.id }
+        }
       )
       .then((res) => {
         if (this._isMounted) {

+ 3 - 2
dashboard/src/main/home/cluster-dashboard/env-groups/CreateEnvGroup.tsx

@@ -113,10 +113,11 @@ export default class CreateEnvGroup extends Component<PropsType, StateType> {
     api
       .getNamespaces(
         "<token>",
+        {},
         {
+          id: currentProject.id,
           cluster_id: this.props.currentCluster.id,
-        },
-        { id: currentProject.id }
+        }
       )
       .then((res) => {
         if (res.data) {

+ 3 - 2
dashboard/src/main/home/launch/launch-flow/SettingsPage.tsx

@@ -91,10 +91,11 @@ class SettingsPage extends Component<PropsType, StateType> {
     api
       .getNamespaces(
         "<token>",
+        {},
         {
+          id: currentProject.id,
           cluster_id: id,
-        },
-        { id: currentProject.id }
+        }
       )
       .then((res) => {
         if (res.data) {

+ 4 - 3
dashboard/src/shared/api.tsx

@@ -611,12 +611,13 @@ const getMetrics = baseApi<
 });
 
 const getNamespaces = baseApi<
+  {},
   {
+    id: number;
     cluster_id: number;
-  },
-  { id: number }
+  }
 >("GET", (pathParams) => {
-  return `/api/projects/${pathParams.id}/k8s/namespaces`;
+  return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces`;
 });
 
 const getNGINXIngresses = baseApi<