Create variant appends variant in rankings
This commit is contained in:
1 parent
ddffd45071
commit
5d9d34edf4
2 files changed
+2
-2
No files matched your search
@@ -148,7 +148,7 @@ describe("ProductVariantService", () => {
|
|||||||
expect(productVariantRepository.create).toHaveBeenCalledWith({
|
expect(productVariantRepository.create).toHaveBeenCalledWith({
|
||||||
id: IdMap.getId("v2"),
|
id: IdMap.getId("v2"),
|
||||||
product_id: IdMap.getId("ironman"),
|
product_id: IdMap.getId("ironman"),
|
||||||
variant_rank: 0,
|
variant_rank: 1,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
id: IdMap.getId("test"),
|
id: IdMap.getId("test"),
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ class ProductVariantService extends BaseService {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rest.variant_rank) rest.variant_rank = 0
|
if (!rest.variant_rank) rest.variant_rank = product.variants.length
|
||||||
|
|
||||||
const toCreate = {
|
const toCreate = {
|
||||||
...rest,
|
...rest,
|
||||||
|
|||||||
Reference in new issue
Block a user