fixed balance fetch
This commit is contained in:
@@ -200,12 +200,11 @@ func (p *Payments) List(ctx context.Context, filter *model.PaymentFilter) (*mode
|
||||
query = query.And(endpointFilter)
|
||||
}
|
||||
}
|
||||
if ref := strings.TrimSpace(filter.OrganizationRef); ref != "" {
|
||||
orgRef, err := bson.ObjectIDFromHex(ref)
|
||||
if err != nil {
|
||||
p.logger.Warn("Failed to decode organization reference", zap.Error(err), zap.String("provided_org_ref", ref))
|
||||
return nil, err
|
||||
}
|
||||
if orgRef, err := bson.ObjectIDFromHex(strings.TrimSpace(filter.OrganizationRef)); err != nil {
|
||||
p.logger.Warn("Failed to decode organization reference", zap.Error(err),
|
||||
zap.String("provided_org_ref", filter.OrganizationRef))
|
||||
return nil, err
|
||||
} else {
|
||||
query.And(repository.OrgFilter(orgRef))
|
||||
}
|
||||
|
||||
@@ -231,7 +230,7 @@ func (p *Payments) List(ctx context.Context, filter *model.PaymentFilter) (*mode
|
||||
decoder := func(cur *mongo.Cursor) error {
|
||||
item := &model.Payment{}
|
||||
if err := cur.Decode(item); err != nil {
|
||||
p.logger.Warn("Failed to decode item", zap.Error(err), zap.Any("item", cur.Current))
|
||||
p.logger.Warn("Failed to decode item", zap.Error(err))
|
||||
return err
|
||||
}
|
||||
payments = append(payments, item)
|
||||
|
||||
Reference in New Issue
Block a user