fix: update product images (#494)
This commit is contained in:
1 parent
0cf9e416f3
commit
c0e947f47a
2 files changed
+26
-3
No files matched your search
@@ -295,7 +295,7 @@ class ProductService extends BaseService {
|
||||
|
||||
let product = productRepo.create(rest)
|
||||
|
||||
if (images && images.length) {
|
||||
if (images) {
|
||||
product.images = await this.upsertImages_(images)
|
||||
}
|
||||
|
||||
@@ -380,11 +380,11 @@ class ProductService extends BaseService {
|
||||
...rest
|
||||
} = update
|
||||
|
||||
if (!product.thumbnail && !update.thumbnail && images && images.length) {
|
||||
if (!product.thumbnail && !update.thumbnail && images?.length) {
|
||||
product.thumbnail = images[0]
|
||||
}
|
||||
|
||||
if (images && images.length) {
|
||||
if (images) {
|
||||
product.images = await this.upsertImages_(images)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user