fix: rename commentIndex variable to commentID for clarity

This commit is contained in:
2025-07-30 01:16:59 -04:00
committed by fdrake
parent 6b524fa01a
commit 50fb3bd626

View File

@@ -363,13 +363,13 @@ func GetSingleIssueCommentByIndexFn(ctx context.Context, req mcp.CallToolRequest
if !ok {
return to.ErrorResult(fmt.Errorf("repo is required"))
}
commentIndex, ok := req.GetArguments()["commentIndex"].(float64)
commentID, ok := req.GetArguments()["commentIndex"].(float64)
if !ok {
return to.ErrorResult(fmt.Errorf("commentIndex is required"))
}
comment, _, err := gitea.Client().GetIssueComment(owner, repo, int64(commentIndex))
comment, _, err := gitea.Client().GetIssueComment(owner, repo, int64(commentID))
if err != nil {
return to.ErrorResult(fmt.Errorf("get %v/%v/issues/comments/%v err: %v", owner, repo, int64(commentIndex), err))
return to.ErrorResult(fmt.Errorf("get %v/%v/issues/comments/%v err: %v", owner, repo, int64(commentID), err))
}
return to.TextResult(comment)