Procházet zdrojové kódy

Fix get incidents by release name query

jnfrati před 4 roky
rodič
revize
a8a5f683d1

+ 4 - 3
dashboard/src/main/home/cluster-dashboard/expanded-chart/incidents/IncidentsTable.tsx

@@ -30,12 +30,13 @@ const IncidentsTable = ({
     api
       .getIncidentsByReleaseName<{ incidents: IncidentsWithoutEvents[] }>(
         "<token>",
-        {},
         {
-          project_id: currentProject.id,
-          cluster_id: currentCluster.id,
           namespace: namespace,
           release_name: releaseName,
+        },
+        {
+          project_id: currentProject.id,
+          cluster_id: currentCluster.id,
         }
       )
       .then((res) => {

+ 6 - 5
dashboard/src/shared/api.tsx

@@ -1601,17 +1601,18 @@ const getIncidents = baseApi<
 );
 
 const getIncidentsByReleaseName = baseApi<
-  {},
   {
-    project_id: number;
-    cluster_id: number;
     namespace: string;
     release_name: string;
+  },
+  {
+    project_id: number;
+    cluster_id: number;
   }
 >(
   "GET",
-  ({ project_id, cluster_id, namespace, release_name: name }) =>
-    `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/incidents`
+  ({ project_id, cluster_id }) =>
+    `/api/projects/${project_id}/clusters/${cluster_id}/incidents`
 );
 
 const getIncidentById = baseApi<