framework-do-dede 0.0.21 → 0.0.24
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.
|
@@ -27,11 +27,8 @@ export function Middleware(middlewareClass) {
|
|
|
27
27
|
if (!middlewareClass.prototype.execute) {
|
|
28
28
|
throw new FrameworkError('Middleware must implement execute()');
|
|
29
29
|
}
|
|
30
|
-
// Get existing middlewares or initialize empty array
|
|
31
30
|
const middlewares = Reflect.getMetadata('middlewares', target, propertyKey) || [];
|
|
32
|
-
// Store the middleware class reference
|
|
33
31
|
middlewares.push(middlewareClass);
|
|
34
|
-
// Update metadata
|
|
35
32
|
Reflect.defineMetadata('middlewares', middlewares, target, propertyKey);
|
|
36
33
|
};
|
|
37
34
|
}
|
|
@@ -48,7 +48,7 @@ export default class ControllerHandler {
|
|
|
48
48
|
statusCode: routeConfig.statusCode,
|
|
49
49
|
instance,
|
|
50
50
|
instanceMethod: methodName,
|
|
51
|
-
middlewares,
|
|
51
|
+
middlewares: middlewares ? middlewares.map(middleware => Registry.classLoader(middleware)) : [],
|
|
52
52
|
validation
|
|
53
53
|
});
|
|
54
54
|
}
|