chore: address pull request review issues
This commit is contained in:
@@ -23,12 +23,6 @@ func (s *SpecificPriceService) Create(ctx context.Context, pr *model.SpecificPri
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if pr.Scope == "shop" && len(pr.ProductIDs) == 0 && len(pr.CategoryIDs) == 0 && len(pr.ProductAttributeIDs) == 0 && len(pr.CountryIDs) == 0 && len(pr.CustomerIDs) == 0 {
|
||||
// pr.Scope = "global"
|
||||
} else {
|
||||
// pr.Scope = "scoped"
|
||||
}
|
||||
|
||||
if err := s.specificPriceRepo.Create(ctx, pr); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -51,12 +45,6 @@ func (s *SpecificPriceService) Update(ctx context.Context, id uint64, pr *model.
|
||||
|
||||
pr.ID = id
|
||||
|
||||
if pr.Scope == "shop" && len(pr.ProductIDs) == 0 && len(pr.CategoryIDs) == 0 && len(pr.ProductAttributeIDs) == 0 && len(pr.CountryIDs) == 0 && len(pr.CustomerIDs) == 0 {
|
||||
// pr.Scope = "global"
|
||||
} else {
|
||||
// pr.Scope = "scoped"
|
||||
}
|
||||
|
||||
if err := s.specificPriceRepo.Update(ctx, pr); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user