feat: remove product price deletion logic in update and destroy methods of ProductService and ProductVariantService
This commit is contained in:
parent
b0cb117e60
commit
078d4e2461
@ -238,7 +238,6 @@ public function update(Product $product, array $data): Product
|
||||
$product->productVariants()
|
||||
->whereNotIn('id', $existingVariantIds)
|
||||
->each(function (ProductVariant $variant) {
|
||||
$variant->productPrices()->delete();
|
||||
$variant->delete();
|
||||
});
|
||||
|
||||
@ -417,7 +416,6 @@ public function destroy(Product $product): bool
|
||||
|
||||
$result = DB::transaction(function () use ($product) {
|
||||
$product->productVariants->each(function (ProductVariant $variant) {
|
||||
$variant->productPrices()->delete();
|
||||
$variant->delete();
|
||||
});
|
||||
|
||||
|
||||
@ -184,8 +184,6 @@ public function destroy(Product $product, ProductVariant $variant): bool
|
||||
$this->assertNotPending($product);
|
||||
|
||||
$result = DB::transaction(function () use ($variant) {
|
||||
$variant->productPrices()->delete();
|
||||
|
||||
return $variant->delete();
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user