framework-do-dede 2.0.15 → 2.0.17

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.
@@ -2,13 +2,13 @@ import { USE_CASE_DECORATORS } from "../decorators/usecase";
2
2
  import { Registry } from "../di/registry";
3
3
  export default class UseCaseHandler {
4
4
  static load(useCaseClass, request) {
5
- const instance = Registry.classLoader(useCaseClass);
6
5
  const useCaseDecorators = Reflect.getMetadata(USE_CASE_DECORATORS, useCaseClass) || [];
7
6
  const useCaseDecoratorsInstances = [];
8
7
  for (const useCaseDecorator of useCaseDecorators) {
9
8
  if (typeof useCaseDecorator === 'function') {
10
9
  const instanceDecorator = Registry.classLoader(useCaseDecorator);
11
- const contextDecoratorsMetadata = Reflect.getMetadata('context', useCaseClass) || [];
10
+ const context = request;
11
+ const contextDecoratorsMetadata = Reflect.getMetadata('context', useCaseDecorator) || [];
12
12
  contextDecoratorsMetadata.forEach(({ propertyKey, middlewareKey }) => {
13
13
  if (context?.middlewareData?.[middlewareKey]) {
14
14
  instanceDecorator[propertyKey] = context.middlewareData[middlewareKey];
@@ -20,6 +20,7 @@ export default class UseCaseHandler {
20
20
  useCaseDecoratorsInstances.push(useCaseDecorator);
21
21
  }
22
22
  }
23
+ const instance = Registry.classLoader(useCaseClass);
23
24
  const context = request;
24
25
  const contextMetadata = Reflect.getMetadata('context', useCaseClass) || [];
25
26
  contextMetadata.forEach(({ propertyKey, middlewareKey }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framework-do-dede",
3
- "version": "2.0.15",
3
+ "version": "2.0.17",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",