Skip to content

Commit

Permalink
Fix results argument must be a pointer to a slice, but was a pointer …
Browse files Browse the repository at this point in the history
…to ptr
  • Loading branch information
milosgagovic committed Oct 23, 2023
1 parent 0f922e8 commit 9a0f478
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions domain/redirectdefinition/repository/redirectdefinition.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ func (rs RedirectsDefinitionRepository) Find(ctx context.Context, id, source str
return &result, nil
}

func (rs RedirectsDefinitionRepository) FindAll(ctx context.Context) (defs *redirectstore.RedirectDefinitions, err error) {
err = rs.collection.Find(ctx, bson.M{}, &defs)
func (rs RedirectsDefinitionRepository) FindAll(ctx context.Context) (*redirectstore.RedirectDefinitions, error) {
var result redirectstore.RedirectDefinitions
err := rs.collection.Find(ctx, bson.M{}, &result)
if err != nil {
return nil, err
}
return defs, nil
return &result, nil
}

func (rs RedirectsDefinitionRepository) Insert(ctx context.Context, def *redirectstore.RedirectDefinition) error {
Expand Down
1 change: 1 addition & 0 deletions domain/redirectdefinition/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func (rs *Service) CreateRedirectsFromContentserverexport(
w http.ResponseWriter,
r *http.Request,
old, new map[string]*content.RepoNode) error {
rs.l.Info("CreateRedirectsFromContentserverexport called ")
return rs.api.CreateRedirects(r.Context(),
redirectcommand.CreateRedirects{
OldState: old,
Expand Down

0 comments on commit 9a0f478

Please sign in to comment.