From 2f5c182b90562f26ad26d1245f84b78e621e43b9 Mon Sep 17 00:00:00 2001 From: Bhaskara Kishore Date: Wed, 19 Apr 2023 12:04:44 +0530 Subject: [PATCH 1/2] change --- src/handlers/supplierHandler.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/handlers/supplierHandler.js b/src/handlers/supplierHandler.js index 6eb556fd..dc9bc414 100644 --- a/src/handlers/supplierHandler.js +++ b/src/handlers/supplierHandler.js @@ -1018,6 +1018,7 @@ exports.getPendingSuppliers = async (req, reply) => { (request) => request.supplierId ); console.log(supplierIdsToInclude, "SUPLIERINCLUDE"); + const timestamps = friendRequests.map(request => moment(request.timestamp, "DD-MM-YYYYTHH:mm:ss.SSSZ").format("DD-MM-YYYY hh:mm:ss") ); From 3f7f36d5661937c64e045ff74e5366ab009f02d0 Mon Sep 17 00:00:00 2001 From: Bhaskara Kishore Date: Wed, 19 Apr 2023 13:04:43 +0530 Subject: [PATCH 2/2] changes --- src/api-docs/api.html | 2 +- src/config/swagger.js | 4 ++-- src/handlers/supplierHandler.js | 13 +++++++------ src/index.js | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/api-docs/api.html b/src/api-docs/api.html index dfbff504..7ea0f07a 100644 --- a/src/api-docs/api.html +++ b/src/api-docs/api.html @@ -49,7 +49,7 @@ diff --git a/src/config/swagger.js b/src/config/swagger.js index 65e23ec6..0361806f 100644 --- a/src/config/swagger.js +++ b/src/config/swagger.js @@ -14,8 +14,8 @@ exports.options = { }, // We have to change this beacause this is running on local // we have to run on this on swagger - //host: "localhost:3000", //Devlopemnt host on lcoal - host: "35.207.198.4:3000", //Production for swagger + host: "localhost:5000", //Devlopemnt host on lcoal + //host: "35.207.198.4:3000", //Production for swagger schemes: ["http"], consumes: ["application/json"], produces: ["application/json"], diff --git a/src/handlers/supplierHandler.js b/src/handlers/supplierHandler.js index dc9bc414..35e04d85 100644 --- a/src/handlers/supplierHandler.js +++ b/src/handlers/supplierHandler.js @@ -1019,9 +1019,7 @@ exports.getPendingSuppliers = async (req, reply) => { ); console.log(supplierIdsToInclude, "SUPLIERINCLUDE"); - const timestamps = friendRequests.map(request => - moment(request.timestamp, "DD-MM-YYYYTHH:mm:ss.SSSZ").format("DD-MM-YYYY hh:mm:ss") - ); + const timestamps = friendRequests.map(request => request.timestamp); console.log(timestamps, "timestamps"); await Supplier.find({ supplierId: { $in: supplierIdsToInclude } }) .limit(limit) @@ -1096,9 +1094,12 @@ exports.getPendingCustomers = async (req, reply) => { const supplierIdsToInclude = friendRequests.map( (request) => request.customerId ); - const timestamps = friendRequests.map(request => - moment(request.timestamp, "DD-MM-YYYYTHH:mm:ss.SSSZ").format("DD-MM-YYYY hh:mm:ss") - ); + // const timestamps = friendRequests.map(request => + // moment(request.timestamp, "DD-MM-YYYYTHH:mm:ss.SSSZ").format("DD-MM-YYYY hh:mm:ss") + // ); + const timestamps = friendRequests.map(request => request.timestamp); + console.log(timestamps, "timestamps"); + await User.find({ customerId: { $in: supplierIdsToInclude } }) .limit(limit) .skip(startindex) diff --git a/src/index.js b/src/index.js index 0af4d460..fe6b5a6f 100644 --- a/src/index.js +++ b/src/index.js @@ -361,7 +361,7 @@ const start = async () => { try { - await fastify.listen(3000, "0.0.0.0"); + await fastify.listen(5000, "0.0.0.0"); fastify.log.info(`listening on ${fastify.server.address().port}`); fastify.log.info(`server listening on ${fastify.config}`); } catch (err) {