Skip to content

Commit

Permalink
rollback. to 404 error
Browse files Browse the repository at this point in the history
  • Loading branch information
ktkfree committed Apr 3, 2023
1 parent d0bb841 commit 1165248
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/repository/cloud-setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (r *CloudSettingRepository) Fetch(organizationId string) (out []domain.Clou
return nil, res.Error
}
if res.RowsAffected == 0 {
return nil, httpErrors.NewNoContentError(fmt.Errorf("No data found"))
return nil, httpErrors.NewNotFoundError(fmt.Errorf("No data found"))
}

for _, cloudSetting := range cloudSettings {
Expand Down
4 changes: 2 additions & 2 deletions internal/repository/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (r *UserRepository) List(filters ...FilterFunc) (*[]domain.User, error) {
return nil, res.Error
}
if res.RowsAffected == 0 {
return nil, httpErrors.NewNoContentError(httpErrors.NoContent)
return nil, httpErrors.NewNotFoundError(httpErrors.NotFound)
}

var out []domain.User
Expand Down Expand Up @@ -316,7 +316,7 @@ func (r *UserRepository) FetchRoles() (*[]domain.Role, error) {
}

if res.RowsAffected == 0 {
return nil, httpErrors.NewNoContentError(httpErrors.NoContent)
return nil, httpErrors.NewNotFoundError(httpErrors.NotFound)
}

var out []domain.Role
Expand Down
4 changes: 2 additions & 2 deletions internal/usecase/organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (u *OrganizationUsecase) Delete(organizationId string, accessToken string)
func (u *OrganizationUsecase) Update(organizationId string, in domain.UpdateOrganizationRequest) (err error) {
_, err = u.Get(organizationId)
if err != nil {
return httpErrors.NewNoContentError(err)
return httpErrors.NewNotFoundError(err)
}

_, err = u.repo.Update(organizationId, in)
Expand All @@ -139,7 +139,7 @@ func (u *OrganizationUsecase) UpdatePrimaryClusterId(organizationId string, clus

organization, err := u.Get(organizationId)
if err != nil {
return httpErrors.NewNoContentError(err)
return httpErrors.NewNotFoundError(err)
}

// [TODO] need refactoring about reflect
Expand Down

0 comments on commit 1165248

Please sign in to comment.