From 4bdd4bcd9ddaf85b06fa352f05799ec26c85f0fa Mon Sep 17 00:00:00 2001 From: Varun Date: Wed, 2 Jul 2025 12:09:56 +0530 Subject: [PATCH] changes --- src/routes/usersRoute.js | 48 +++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/routes/usersRoute.js b/src/routes/usersRoute.js index 42920793..add99d18 100644 --- a/src/routes/usersRoute.js +++ b/src/routes/usersRoute.js @@ -1123,31 +1123,33 @@ fastify.get("/api/cart/:customerId", { - fastify.route({ - method: "POST", - url: "/api/getuserOrders/:customerId", - schema: { - description: "To Get orders of customer", - tags: ["User"], - summary: "This is for Geting orders of customer", - params: { - type: "object", - properties: { - customerId: { - type: "string", - description: "customerId", - }, - }, +fastify.route({ + method: "GET", + url: "/api/getuserOrders/:customerId", + schema: { + description: "To Get orders of customer", + tags: ["User"], + summary: "This is for getting orders of a customer", + params: { + type: "object", + properties: { + customerId: { + type: "string", + description: "Customer ID", }, - security: [ - { - basicAuth: [], - }, - ], }, - //preHandler: fastify.auth([fastify.authenticate]), - handler: userController.getuserOrders, - }); + required: ["customerId"] + }, + security: [ + { + basicAuth: [], + }, + ], + }, + // preHandler: fastify.auth([fastify.authenticate]), + handler: userController.getuserOrders, +}); + next();