fix: 删除缺陷 (#2177)

Co-authored-by: chenjianxing <jianxing.chen@fit2cloud.com>
This commit is contained in:
metersphere-bot 2021-04-22 14:28:08 +08:00 committed by GitHub
parent f393834aad
commit 6980c6aaa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 2 deletions

View File

@ -21,6 +21,10 @@
<sql id="queryWhereCondition">
<where>
<if test="request.name != null">
and issues.title LIKE CONCAT('%', #{request.name}, '%')
</if>
<if test="request.projectId != null and request.projectId != ''">
and issues.project_id = #{request.projectId}
</if>

View File

@ -59,6 +59,11 @@ public class IssuesController {
issuesService.deleteIssue(request);
}
@GetMapping("/delete/{id}")
public void delete(@PathVariable String id) {
issuesService.delete(id);
}
@GetMapping("/tapd/user/{caseId}")
public List<PlatformUser> getTapdUsers(@PathVariable String caseId) {
return issuesService.getTapdProjectUsers(caseId);

View File

@ -248,6 +248,14 @@ public class IssuesService {
testCaseIssuesMapper.deleteByExample(example);
}
public void delete(String id) {
issuesMapper.deleteByPrimaryKey(id);
TestCaseIssuesExample example = new TestCaseIssuesExample();
example.createCriteria()
.andIssuesIdEqualTo(id);
testCaseIssuesMapper.deleteByExample(example);
}
private static String getIssuesContext(SessionUser user, IssuesUpdateRequest issuesRequest, String type) {
String context = "";
if (StringUtils.equals(NoticeConstants.Event.CREATE, type)) {

View File

@ -4,7 +4,7 @@
<template v-slot:header>
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="getIssues" @create="handleCreate"
:create-tip="'创建缺陷'" :title="'缺陷列表'"/>
:create-tip="'创建缺陷'" :title="'缺陷列表'" :tip="'根据标题搜索'"/>
</template>
<ms-table
@ -147,7 +147,7 @@ export default {
this.$refs.issueEdit.open(copyData);
},
handleDelete(data) {
this.result = this.$get('custom/field/delete/' + data.id, () => {
this.result = this.$get('issues/delete/' + data.id, () => {
this.$success(this.$t('commons.delete_success'));
this.getIssues();
});