|
|
|
@ -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)
|
|
|
|
|