Skip to content

Commit

Permalink
refactor: Removing concat error to use httputils one
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Mar 5, 2021
1 parent b69af7b commit e09288f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 27 deletions.
5 changes: 2 additions & 3 deletions pkg/service/ketchup/ketchup.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
httpModel "github.com/ViBiOh/httputils/v4/pkg/model"
"github.com/ViBiOh/ketchup/pkg/model"
"github.com/ViBiOh/ketchup/pkg/semver"
"github.com/ViBiOh/ketchup/pkg/service"
"github.com/ViBiOh/ketchup/pkg/service/repository"
"github.com/ViBiOh/ketchup/pkg/store/ketchup"
)
Expand Down Expand Up @@ -156,7 +155,7 @@ func (a app) check(ctx context.Context, old, new model.Ketchup) error {
}

if new.Repository.ID == 0 && new.User.ID == 0 {
return service.ConcatError(output)
return httpModel.ConcatError(output)
}

if len(strings.TrimSpace(new.Pattern)) == 0 {
Expand All @@ -178,7 +177,7 @@ func (a app) check(ctx context.Context, old, new model.Ketchup) error {
}
}

return service.ConcatError(output)
return httpModel.ConcatError(output)
}

func enrichKetchupsWithSemver(list []model.Ketchup) []model.Ketchup {
Expand Down
3 changes: 1 addition & 2 deletions pkg/service/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/ViBiOh/ketchup/pkg/helm"
"github.com/ViBiOh/ketchup/pkg/model"
"github.com/ViBiOh/ketchup/pkg/semver"
"github.com/ViBiOh/ketchup/pkg/service"
"github.com/ViBiOh/ketchup/pkg/store/repository"
)

Expand Down Expand Up @@ -194,7 +193,7 @@ func (a app) check(ctx context.Context, old, new model.Repository) error {
output = append(output, errors.New("name already exists"))
}

return service.ConcatError(output)
return httpModel.ConcatError(output)
}

func (a app) LatestVersions(repo model.Repository) (map[string]semver.Version, error) {
Expand Down
20 changes: 0 additions & 20 deletions pkg/service/service.go

This file was deleted.

3 changes: 1 addition & 2 deletions pkg/service/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/ViBiOh/httputils/v4/pkg/logger"
httpModel "github.com/ViBiOh/httputils/v4/pkg/model"
"github.com/ViBiOh/ketchup/pkg/model"
"github.com/ViBiOh/ketchup/pkg/service"
"github.com/ViBiOh/ketchup/pkg/store/user"
)

Expand Down Expand Up @@ -102,5 +101,5 @@ func (a app) check(ctx context.Context, _, new model.User) error {
output = append(output, errors.New("email already used"))
}

return service.ConcatError(output)
return httpModel.ConcatError(output)
}

0 comments on commit e09288f

Please sign in to comment.