소스 검색

Fix get incidents by release name query

jnfrati 4 년 전
부모
커밋
a8a5f683d1
2개의 변경된 파일10개의 추가작업 그리고 8개의 파일을 삭제
  1. 4 3
      dashboard/src/main/home/cluster-dashboard/expanded-chart/incidents/IncidentsTable.tsx
  2. 6 5
      dashboard/src/shared/api.tsx

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

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

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

@@ -1601,17 +1601,18 @@ const getIncidents = baseApi<
 );
 );
 
 
 const getIncidentsByReleaseName = baseApi<
 const getIncidentsByReleaseName = baseApi<
-  {},
   {
   {
-    project_id: number;
-    cluster_id: number;
     namespace: string;
     namespace: string;
     release_name: string;
     release_name: string;
+  },
+  {
+    project_id: number;
+    cluster_id: number;
   }
   }
 >(
 >(
   "GET",
   "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<
 const getIncidentById = baseApi<