Skip to content

Commit

Permalink
fix(api/repo): support Sqlite boolean filter for active
Browse files Browse the repository at this point in the history
  • Loading branch information
ecrupper committed Jan 2, 2024
1 parent a7cd07f commit 711ac73
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions api/repo/list_org.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,19 @@ func ListReposForOrg(c *gin.Context) {
// capture the sort_by query parameter if present
sortBy := util.QueryParameter(c, "sort_by", "name")

filters := map[string]interface{}{}

// capture the query parameters if present:
//
// * active
filters := map[string]interface{}{
"active": util.QueryParameter(c, "active", "true"),
active := util.QueryParameter(c, "active", "1")
if b, err := strconv.ParseBool(active); err == nil {
qBool := "0"
if b {
qBool = "1"
}

filters["active"] = qBool
}

// See if the user is an org admin to bypass individual permission checks
Expand Down

0 comments on commit 711ac73

Please sign in to comment.