feat: customer list
This commit is contained in:
@@ -86,6 +86,17 @@ func (s *UserService) GetAll(ctx mycontext.Context, search entity.UserSearch) ([
|
||||
return users.ToUserList(), total, nil
|
||||
}
|
||||
|
||||
func (s *UserService) GetAllCustomer(ctx mycontext.Context, search entity.CustomerSearch) ([]*entity.Customer, int, error) {
|
||||
|
||||
users, total, err := s.repo.GetAllCustomer(ctx, search)
|
||||
if err != nil {
|
||||
logger.ContextLogger(ctx).Error("error when get all users", zap.Error(err))
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
return users.ToCustomerList(), total, nil
|
||||
}
|
||||
|
||||
func (s *UserService) GetByID(ctx mycontext.Context, id int64) (*entity.User, error) {
|
||||
userDB, err := s.repo.GetUserByID(ctx, id)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user