From 16e50542e447af29a758764494bfce06bb2021dc Mon Sep 17 00:00:00 2001 From: Michael Avoyan Date: Mon, 1 Jul 2024 18:22:39 +0300 Subject: [PATCH] Update vclSdkPlugin.ts --- packages/sample-server/src/plugins/vclSdkPlugin.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/sample-server/src/plugins/vclSdkPlugin.ts b/packages/sample-server/src/plugins/vclSdkPlugin.ts index f8b9688..7d1391a 100644 --- a/packages/sample-server/src/plugins/vclSdkPlugin.ts +++ b/packages/sample-server/src/plugins/vclSdkPlugin.ts @@ -5,7 +5,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { FastifyPluginAsync, FastifyInstance } from 'fastify'; import { VCLProvider, VCLInitializationDescriptor, @@ -18,7 +17,7 @@ import { } from '../crypto-services'; import { CurrentEnvironment, XVnfProtocolVersion } from '../global-config'; -const vclSdkPlugin: FastifyPluginAsync = async (fastify: FastifyInstance) => { +const vclSdkPlugin = async (fastify) => { const vclSdk = VCLProvider.getInstance(); const initializationDescriptor = new VCLInitializationDescriptor( @@ -40,11 +39,10 @@ const vclSdkPlugin: FastifyPluginAsync = async (fastify: FastifyInstance) => { fastify.decorate('vclSdk', vclSdk); - const setVclSdk = async (req: any, reply: any) => { + const setVclSdk = async (req, reply) => { req.vclSdk = fastify.vclSdk; reply.vclSdk = fastify.vclSdk; }; - fastify.addHook('preHandler', setVclSdk); fastify.addHook('preValidation', setVclSdk); };