Skip to content

Commit

Permalink
Merge pull request #2264 from wangyu096/issue_2263
Browse files Browse the repository at this point in the history
fix: 脚本管理页面,批量编辑标签报错 #2263
  • Loading branch information
jsonwan authored Jul 21, 2023
2 parents 8a6c541 + 10fc24e commit 451e9b3
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,11 @@ public Response<?> batchUpdateScriptTags(String username,
return Response.buildValidateFailResp(validateResult);
}

if (CollectionUtils.isEmpty(req.getAddTagIdList()) && CollectionUtils.isEmpty(req.getDeleteTagIdList())) {
// do nothing
return Response.buildSuccessResp(true);
}

boolean isPublicScript = appResourceScope == null;
List<String> scriptIdList = req.getIdList();
AuthResult authResult;
Expand Down Expand Up @@ -1131,12 +1136,6 @@ private ValidateResult checkScriptTagBatchPatchReq(ScriptTagBatchPatchReq req) {
log.warn("ScriptTagBatchUpdateReq->idList is empty");
return ValidateResult.fail(ErrorCode.ILLEGAL_PARAM_WITH_PARAM_NAME, "idList");
}

if (CollectionUtils.isEmpty(req.getAddTagIdList()) && CollectionUtils.isEmpty(req.getDeleteTagIdList())) {
log.warn("ScriptTagBatchUpdateReq->No script tags changed!");
return ValidateResult.fail(ErrorCode.ILLEGAL_PARAM_WITH_PARAM_NAME,
"addTagIdList|deleteTagIdList");
}
return ValidateResult.pass();
}

Expand Down

0 comments on commit 451e9b3

Please sign in to comment.