fix: update product images (#494)

This commit is contained in:
Sebastian Mateos Nicolajsen authored and GitHub committed 2021-10-13 12:05:58 +02:00
1 parent 0cf9e416f3
commit c0e947f47a
2 files changed
+26 -3

No files matched your search

+3 -3
View File
@@ -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)
}