feat: rm page limit

This commit is contained in:
xiaobing.wang
2023-11-22 12:04:35 +08:00
parent 03986c0195
commit d3582a86ab
2 changed files with 2 additions and 14 deletions

View File

@@ -11,14 +11,12 @@ import (
// GitHubHandler provides HTTP handlers for GitHub operations.
type GitHubHandler struct {
gitHubService *service.GitHubService
pageLimit int
}
// NewGitHubHandler creates a new instance of GitHubHandler.
func NewGitHubHandler(gitHubService *service.GitHubService, pageLimit int) *GitHubHandler {
func NewGitHubHandler(gitHubService *service.GitHubService) *GitHubHandler {
return &GitHubHandler{
gitHubService: gitHubService,
pageLimit: pageLimit,
}
}
@@ -39,10 +37,6 @@ func (h *GitHubHandler) GetIssues(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
if len(issues) > h.pageLimit {
c.JSON(http.StatusOK, issues[:h.pageLimit])
return
}
c.JSON(http.StatusOK, issues)
}
@@ -64,10 +58,5 @@ func (h *GitHubHandler) GetDiscussions(c *gin.Context) {
return
}
if len(discussions) > h.pageLimit {
c.JSON(http.StatusOK, discussions[:h.pageLimit])
return
}
c.JSON(http.StatusOK, discussions)
}