You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/11/23 13:13:08 UTC

[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3797: refactor: add transformation_rule_id to _tool_jira_boards

likyh commented on code in PR #3797:
URL: https://github.com/apache/incubator-devlake/pull/3797#discussion_r1030428179


##########
plugins/jira/api/scope.go:
##########
@@ -122,3 +149,16 @@ func extractParam(params map[string]string) (uint64, uint64) {
 	boardId, _ := strconv.ParseUint(params["boardId"], 10, 64)
 	return connectionId, boardId
 }
+
+func verifyBoard(board *models.JiraBoard) errors.Error {
+	if board.ConnectionId == 0 {
+		return errors.BadInput.New("invalid connectionId")
+	}
+	if board.BoardId == 0 {
+		return errors.BadInput.New("invalid boardId")
+	}
+	if board.ScopeId != strconv.FormatUint(board.BoardId, 10) {

Review Comment:
   why not set `board.ScopeId = board.BoardId` instead reading it from frontend?



##########
plugins/jira/api/scope.go:
##########
@@ -122,3 +149,16 @@ func extractParam(params map[string]string) (uint64, uint64) {
 	boardId, _ := strconv.ParseUint(params["boardId"], 10, 64)
 	return connectionId, boardId
 }
+
+func verifyBoard(board *models.JiraBoard) errors.Error {
+	if board.ConnectionId == 0 {
+		return errors.BadInput.New("invalid connectionId")
+	}
+	if board.BoardId == 0 {
+		return errors.BadInput.New("invalid boardId")
+	}
+	if board.ScopeId != strconv.FormatUint(board.BoardId, 10) {

Review Comment:
   why not set `board.ScopeId = board.BoardId` instead of reading it from frontend?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org