Skip to content

Commit

Permalink
fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintWish committed Sep 29, 2024
1 parent aaaf896 commit 2075d11
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/controller/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (c *Controller) GetAllUsers(w http.ResponseWriter, r *http.Request) {
return
}

response.Result(w, users)
response.OK(w, users)
return
}

Expand Down
8 changes: 5 additions & 3 deletions internal/database/bbolt/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ func (d *bboltDB) GetAllUsers() ([]*schema.User, error) {
return fmt.Errorf("bson: failed to unmarshal %v", err)
}

users.append(user)
users = append(users, user)

return nil
}); err != nil {
return err
}

return users, nil
return nil
}); err != nil {
return users, err
return users, nil
}

return users, nil
Expand Down
2 changes: 1 addition & 1 deletion internal/database/mongodb/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"go.mongodb.org/mongo-driver/bson"
)

func (d *mongoDB) GetUser() ([]*schema.User, error) {
func (d *mongoDB) GetAllUsers() ([]*schema.User, error) {
var users []*schema.User
return users, nil
}
Expand Down

0 comments on commit 2075d11

Please sign in to comment.