@unchainedshop/core-products 2.0.4 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { ProductStatus } from '../db/ProductStatus.js';
2
- export const removeProductService = async ({ productId }, unchainedApi) => {
3
- const { modules } = unchainedApi;
2
+ export const removeProductService = async ({ productId }, unchainedAPI) => {
3
+ const { modules } = unchainedAPI;
4
4
  const product = await modules.products.findProduct({ productId });
5
5
  switch (product.status) {
6
6
  case ProductStatus.ACTIVE:
@@ -10,7 +10,7 @@ export const removeProductService = async ({ productId }, unchainedApi) => {
10
10
  case ProductStatus.DRAFT:
11
11
  await modules.bookmarks.deleteByProductId(productId);
12
12
  await modules.assortments.products.delete(productId, {});
13
- await modules.orders.positions.removeProductByIdFromAllPositions({ productId }, unchainedApi);
13
+ await modules.orders.positions.removeProductByIdFromAllPositions({ productId }, unchainedAPI);
14
14
  await modules.products.delete(productId);
15
15
  break;
16
16
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unchainedshop/core-products",
3
- "version": "2.0.4",
3
+ "version": "2.0.7",
4
4
  "main": "lib/products-index.js",
5
5
  "exports": {
6
6
  ".": "./lib/products-index.js",
@@ -31,18 +31,18 @@
31
31
  },
32
32
  "homepage": "https://github.com/unchainedshop/unchained#readme",
33
33
  "dependencies": {
34
- "@unchainedshop/events": "^2.0.4",
35
- "@unchainedshop/file-upload": "^2.0.4",
36
- "@unchainedshop/utils": "^2.0.4",
34
+ "@unchainedshop/events": "^2.0.7",
35
+ "@unchainedshop/file-upload": "^2.0.7",
36
+ "@unchainedshop/utils": "^2.0.7",
37
37
  "locale": "^0.1.0",
38
38
  "lru-cache": "^7.14.1",
39
39
  "simpl-schema": "=3.2.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/locale": "^0.1.1",
43
- "@types/node": "^18.13.0",
44
- "@unchainedshop/types": "^2.0.4",
45
- "jest": "^29.4.2",
43
+ "@types/node": "^18.14.0",
44
+ "@unchainedshop/types": "^2.0.7",
45
+ "jest": "^29.4.3",
46
46
  "ts-jest": "^29.0.5",
47
47
  "typescript": "^4.9.5"
48
48
  }
@@ -2,8 +2,8 @@
2
2
  import { RemoveProductService } from '@unchainedshop/types/products.js';
3
3
  import { ProductStatus } from '../db/ProductStatus.js';
4
4
 
5
- export const removeProductService: RemoveProductService = async ({ productId }, unchainedApi) => {
6
- const { modules } = unchainedApi;
5
+ export const removeProductService: RemoveProductService = async ({ productId }, unchainedAPI) => {
6
+ const { modules } = unchainedAPI;
7
7
  const product = await modules.products.findProduct({ productId });
8
8
  switch (product.status) {
9
9
  case ProductStatus.ACTIVE:
@@ -13,7 +13,7 @@ export const removeProductService: RemoveProductService = async ({ productId },
13
13
  case ProductStatus.DRAFT:
14
14
  await modules.bookmarks.deleteByProductId(productId);
15
15
  await modules.assortments.products.delete(productId, {});
16
- await modules.orders.positions.removeProductByIdFromAllPositions({ productId }, unchainedApi);
16
+ await modules.orders.positions.removeProductByIdFromAllPositions({ productId }, unchainedAPI);
17
17
 
18
18
  await modules.products.delete(productId);
19
19
  break;