Browse Source

fix: 删除产物时使用正确参数

Jinyao 5 years ago
parent
commit
1f9f1bc6b4
2 changed files with 8 additions and 7 deletions
  1. 2 4
      src/api/devcloud/pipeline.ts
  2. 6 3
      src/views/Project/Pipeline.vue

+ 2 - 4
src/api/devcloud/pipeline.ts

@@ -56,10 +56,8 @@ export const getPipelinesByProjectId = (projectId: number) => axios.get(`${PIPEL
 });
 
 // DEPLOYMENT API
-export const deleteInstance = (deploymentId: number) => axios.delete(`${DEPLOYMENT_PREFIX}`, {
-  params: {
-    deploymentId,
-  },
+export const deleteInstance = (pipeline: PipelinePayload) => axios.delete(`${DEPLOYMENT_PREFIX}`, {
+  params: pipeline,
 });
 
 export const triggerDeployment = (pipeline: PipelinePayload) => axios.post(`${DEPLOYMENT_PREFIX}`, null, {

+ 6 - 3
src/views/Project/Pipeline.vue

@@ -298,7 +298,7 @@
         </ElTableColumn>
         <ElTableColumn width="60">
           <template #default="scope">
-            <ElButton type="text" @click="deleteProduction(scope.row.id)">
+            <ElButton type="text" @click="deleteProduction(scope.row.pipelineId)">
               <i class="el-icon-delete"></i>
             </ElButton>
           </template>
@@ -468,9 +468,12 @@ export default {
     open(url, target) {
       window.open(url, target);
     },
-    async deleteProduction(id) {
+    async deleteProduction(pipelineId) {
       this.loading = true;
-      await PipelineAPI.deleteInstance(id);
+      await PipelineAPI.deleteInstance({
+        projectId: this.$store.state.workspace.currentProjectId,
+        pipelineId,
+      });
       this.loading = false;
     },
     getStage(stageName) {