diff --git a/packages/express/package.json b/packages/express/package.json index 50712e3342..6da414750b 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -52,7 +52,6 @@ "@feathersjs/commons": "^5.0.0-pre.14", "@feathersjs/errors": "^5.0.0-pre.14", "@feathersjs/feathers": "^5.0.0-pre.14", - "@feathersjs/hooks": "^0.6.5", "@feathersjs/transport-commons": "^5.0.0-pre.14", "@types/express": "^4.17.13", "@types/express-serve-static-core": "^4.17.24", diff --git a/packages/express/src/rest.ts b/packages/express/src/rest.ts index 25c458558a..2976d7fe16 100644 --- a/packages/express/src/rest.ts +++ b/packages/express/src/rest.ts @@ -1,15 +1,14 @@ import { MethodNotAllowed } from '@feathersjs/errors'; -import { HookContext } from '@feathersjs/hooks'; import { createDebug } from '@feathersjs/commons'; import { http } from '@feathersjs/transport-commons'; -import { createContext, defaultServiceMethods, getServiceOptions } from '@feathersjs/feathers'; +import { HookContext, createContext, defaultServiceMethods, getServiceOptions } from '@feathersjs/feathers'; import { Request, Response, NextFunction, RequestHandler, Router } from 'express'; import { parseAuthentication } from './authentication'; const debug = createDebug('@feathersjs/express/rest'); -export type ServiceCallback = (req: Request, res: Response, options: http.ServiceParams) => Promise; +export type ServiceCallback = (req: Request, res: Response, options: http.ServiceParams) => Promise; export const feathersParams = (req: Request, _res: Response, next: NextFunction) => { req.feathers = { @@ -69,7 +68,7 @@ export const serviceMethodHandler = ( const args = getArgs(options); const context = createContext(service, method); - res.hook = context as any; + res.hook = context; return service[method](...args, context); });