diff --git a/app/frontend/src/components/ReadmeDashboard.astro b/app/frontend/src/components/ReadmeDashboard.astro
index d8d95b6..bb6699a 100644
--- a/app/frontend/src/components/ReadmeDashboard.astro
+++ b/app/frontend/src/components/ReadmeDashboard.astro
@@ -52,7 +52,7 @@ const baseURL = import.meta.env.PUBLIC_BASE_URL;
Stats
@@ -152,7 +152,7 @@ const baseURL = import.meta.env.PUBLIC_BASE_URL;
@@ -202,7 +202,7 @@ const baseURL = import.meta.env.PUBLIC_BASE_URL;
@@ -275,12 +275,12 @@ const baseURL = import.meta.env.PUBLIC_BASE_URL;
- ![](https:///chart?org=&repo=&branch=&types=)
+ ![](https:///chart?org=&repo=&branch=&type=)
diff --git a/app/pkg/chart_handler.go b/app/pkg/chart_handler.go
index 232447d..fba4361 100644
--- a/app/pkg/chart_handler.go
+++ b/app/pkg/chart_handler.go
@@ -25,8 +25,7 @@ type ChartRequest struct {
Branch string `json:"branch" query:"branch" validate:"ascii" message:"ascii branch is required"`
User string `json:"user" query:"user" validate:"ascii,excludes=/" message:"ascii user is required"`
BaseBranch string `json:"base_branch" query:"base_branch" validate:"ascii" message:"ascii base_branch is required"`
- Type string `json:"type" query:"type" validate:"ascii" message:"ascii type is required"`
- Types string `json:"types" query:"types" validate:"ascii" message:"ascii types are required"`
+ Type string `json:"type" query:"type" validate:"required,ascii" message:"ascii type is required"`
Branches string `json:"branches" query:"branches" validate:"ascii" message:"ascii branches is required"`
Users string `json:"users" query:"users" validate:"ascii" message:"ascii users is required"`
PRNum int `json:"pr_num" query:"pr_num"`
@@ -52,15 +51,18 @@ func (h *ChartHandler) Get(c echo.Context) error {
if err != nil {
return echo.NewHTTPError(http.StatusUnprocessableEntity, msgs)
}
- if req.Types == "" && req.Type == "" {
- return echo.NewHTTPError(http.StatusUnprocessableEntity, "types or type is required")
+
+ typesMany := []string{}
+ if strings.Contains(req.Type, ",") {
+ typesMany = strings.Split(req.Type, ",")
}
- if req.Types != "" {
+
+ if len(typesMany) > 1 {
if req.Branch == "" {
return echo.NewHTTPError(http.StatusUnprocessableEntity, "branch for types is required")
}
types := []*models.Type{}
- for _, t := range strings.Split(req.Types, ",") {
+ for _, t := range typesMany {
tt, err := h.Chart.GetType(t)
if err != nil {
return echo.NewHTTPError(http.StatusUnprocessableEntity, err.Error())