@medusajs/product 0.4.0-snapshot-20240401075323 → 0.4.0-snapshot-20240401141452
Sign up to get free protection for your applications and to get access to all the features.
@@ -390,7 +390,7 @@ class ProductModuleService extends utils_1.ModulesSdkUtils.abstractModuleService
|
|
390
390
|
async create_(data, sharedContext = {}) {
|
391
391
|
const normalizedInput = data.map(ProductModuleService.normalizeCreateProductInput);
|
392
392
|
const productData = await this.productService_.upsertWithReplace(normalizedInput, {
|
393
|
-
relations: ["
|
393
|
+
relations: ["images", "tags", "categories"],
|
394
394
|
}, sharedContext);
|
395
395
|
await (0, utils_1.promiseAll)(
|
396
396
|
// Note: It's safe to rely on the order here as `upsertWithReplace` preserves the order of the input
|
@@ -418,7 +418,7 @@ class ProductModuleService extends utils_1.ModulesSdkUtils.abstractModuleService
|
|
418
418
|
async update_(data, sharedContext = {}) {
|
419
419
|
const normalizedInput = data.map(ProductModuleService.normalizeUpdateProductInput);
|
420
420
|
const productData = await this.productService_.upsertWithReplace(normalizedInput, {
|
421
|
-
relations: ["
|
421
|
+
relations: ["images", "tags", "categories"],
|
422
422
|
}, sharedContext);
|
423
423
|
// There is more than 1-level depth of relations here, so we need to handle the options and variants manually
|
424
424
|
await (0, utils_1.promiseAll)(
|
@@ -530,6 +530,9 @@ class ProductModuleService extends utils_1.ModulesSdkUtils.abstractModuleService
|
|
530
530
|
option_value_id: optionValue.id,
|
531
531
|
};
|
532
532
|
});
|
533
|
+
if (!variantOptions.length) {
|
534
|
+
return variant;
|
535
|
+
}
|
533
536
|
return {
|
534
537
|
...variant,
|
535
538
|
options: variantOptions,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/product",
|
3
|
-
"version": "0.4.0-snapshot-
|
3
|
+
"version": "0.4.0-snapshot-20240401141452",
|
4
4
|
"description": "Medusa Product module",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"cross-env": "^5.2.1",
|
42
42
|
"faker": "^6.6.6",
|
43
43
|
"jest": "^29.6.3",
|
44
|
-
"medusa-test-utils": "1.1.44-snapshot-
|
44
|
+
"medusa-test-utils": "1.1.44-snapshot-20240401141452",
|
45
45
|
"pg-god": "^1.0.12",
|
46
46
|
"rimraf": "^3.0.2",
|
47
47
|
"ts-jest": "^29.1.1",
|
@@ -50,9 +50,9 @@
|
|
50
50
|
"typescript": "^5.1.6"
|
51
51
|
},
|
52
52
|
"dependencies": {
|
53
|
-
"@medusajs/modules-sdk": "1.12.11-snapshot-
|
54
|
-
"@medusajs/types": "1.12.0-snapshot-
|
55
|
-
"@medusajs/utils": "1.12.0-snapshot-
|
53
|
+
"@medusajs/modules-sdk": "1.12.11-snapshot-20240401141452",
|
54
|
+
"@medusajs/types": "1.12.0-snapshot-20240401141452",
|
55
|
+
"@medusajs/utils": "1.12.0-snapshot-20240401141452",
|
56
56
|
"@mikro-orm/core": "5.9.7",
|
57
57
|
"@mikro-orm/migrations": "5.9.7",
|
58
58
|
"@mikro-orm/postgresql": "5.9.7",
|