Skip to content

Commit

Permalink
fix validator
Browse files Browse the repository at this point in the history
  • Loading branch information
naueramant committed Oct 14, 2024
1 parent 7de91c4 commit 07f4b5e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/rest/v1/private/controllers/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (h *Handlers) newGetProjectVersionsResponse(

type deleteProjectVersionRequest struct {
ProjectID uint `param:"project_id" validate:"required,numeric"`
VersionID string `param:"version_id" validate:"required,max=20,alphanum"`
VersionID string `param:"version_id" validate:"required,semver,max=20"`
}

func (h *Handlers) deleteProjectVersion(c echo.Context, l *logrus.Entry) error {
Expand Down Expand Up @@ -198,7 +198,7 @@ func (h *Handlers) deleteProjectVersion(c echo.Context, l *logrus.Entry) error {

type postProjectVersionRequest struct {
ID int `param:"id" validate:"required,numeric"`
Name string `json:"name" validate:"required,alphanum,max=20"`
Name string `json:"name" validate:"required,semver,max=20"`
}

func (h *Handlers) postProjectVersion(c echo.Context, l *logrus.Entry) error {
Expand Down Expand Up @@ -227,6 +227,7 @@ func (h *Handlers) postProjectVersion(c echo.Context, l *logrus.Entry) error {
)
if err != nil {
l.WithError(err).Error("Error creating project version")

return echo.ErrInternalServerError
}

Expand Down

0 comments on commit 07f4b5e

Please sign in to comment.