fix: Cascade remove prices + option values on variant and product delete (#1465)
This commit is contained in:
@@ -751,7 +751,7 @@ class ProductVariantService extends BaseService {
|
||||
|
||||
const variant = await variantRepo.findOne({
|
||||
where: { id: variantId },
|
||||
relations: ["prices"],
|
||||
relations: ["prices", "options"],
|
||||
})
|
||||
|
||||
if (!variant) {
|
||||
|
||||
@@ -668,7 +668,7 @@ class ProductService extends BaseService {
|
||||
// Should not fail, if product does not exist, since delete is idempotent
|
||||
const product = await productRepo.findOne(
|
||||
{ id: productId },
|
||||
{ relations: ["variants"] }
|
||||
{ relations: ["variants", "variants.prices", "variants.options"] }
|
||||
)
|
||||
|
||||
if (!product) {
|
||||
|
||||
Reference in New Issue
Block a user