|
|
@ -12,6 +12,7 @@ const fastify = require("fastify")({
|
|
|
|
return uuidv4();
|
|
|
|
return uuidv4();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
const moment = require('moment');
|
|
|
|
|
|
|
|
|
|
|
|
const fastifyEnv = require("fastify-env");
|
|
|
|
const fastifyEnv = require("fastify-env");
|
|
|
|
|
|
|
|
|
|
|
@ -1017,7 +1018,9 @@ exports.getPendingSuppliers = async (req, reply) => {
|
|
|
|
(request) => request.supplierId
|
|
|
|
(request) => request.supplierId
|
|
|
|
);
|
|
|
|
);
|
|
|
|
console.log(supplierIdsToInclude, "SUPLIERINCLUDE");
|
|
|
|
console.log(supplierIdsToInclude, "SUPLIERINCLUDE");
|
|
|
|
const timestamps = friendRequests.map((request) => request.timestamp);
|
|
|
|
const timestamps = friendRequests.map(request =>
|
|
|
|
|
|
|
|
moment(request.timestamp).format("DD-MM-YYYY hh:mm:ss")
|
|
|
|
|
|
|
|
);
|
|
|
|
console.log(timestamps, "timestamps");
|
|
|
|
console.log(timestamps, "timestamps");
|
|
|
|
await Supplier.find({ supplierId: { $in: supplierIdsToInclude } })
|
|
|
|
await Supplier.find({ supplierId: { $in: supplierIdsToInclude } })
|
|
|
|
.limit(limit)
|
|
|
|
.limit(limit)
|
|
|
@ -1133,8 +1136,9 @@ exports.getPendingCustomers = async (req, reply) => {
|
|
|
|
const supplierIdsToInclude = friendRequests.map(
|
|
|
|
const supplierIdsToInclude = friendRequests.map(
|
|
|
|
(request) => request.customerId
|
|
|
|
(request) => request.customerId
|
|
|
|
);
|
|
|
|
);
|
|
|
|
const timestamps = friendRequests.map((request) => request.timestamp);
|
|
|
|
const timestamps = friendRequests.map(request =>
|
|
|
|
|
|
|
|
moment(request.timestamp).format("DD-MM-YYYY hh:mm:ss")
|
|
|
|
|
|
|
|
);
|
|
|
|
await User.find({ customerId: { $in: supplierIdsToInclude } })
|
|
|
|
await User.find({ customerId: { $in: supplierIdsToInclude } })
|
|
|
|
.limit(limit)
|
|
|
|
.limit(limit)
|
|
|
|
.skip(startindex)
|
|
|
|
.skip(startindex)
|
|
|
|