|
|
@ -868,7 +868,12 @@ exports.getPendingSuppliers = async (req, reply) => {
|
|
|
|
.skip(startindex)
|
|
|
|
.skip(startindex)
|
|
|
|
.exec()
|
|
|
|
.exec()
|
|
|
|
.then((docs) => {
|
|
|
|
.then((docs) => {
|
|
|
|
reply.send({ status_code: 200, data: docs, count: docs.length ,timestamps});
|
|
|
|
const supplierDataWithTimestamp = docs.map((doc, index) => ({
|
|
|
|
|
|
|
|
data: doc,
|
|
|
|
|
|
|
|
timestamp: timestamps[index]
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
reply.send({ status_code: 200, data: supplierDataWithTimestamp, count: docs.length });
|
|
|
|
|
|
|
|
//reply.send({ status_code: 200, data: docs, count: docs.length ,timestamps});
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
.catch((err) => {
|
|
|
|
console.log(err);
|
|
|
|
console.log(err);
|
|
|
@ -928,7 +933,12 @@ exports.getPendingCustomers = async (req, reply) => {
|
|
|
|
.skip(startindex)
|
|
|
|
.skip(startindex)
|
|
|
|
.exec()
|
|
|
|
.exec()
|
|
|
|
.then((docs) => {
|
|
|
|
.then((docs) => {
|
|
|
|
reply.send({ status_code: 200, data: docs, count: docs.length ,timestamps});
|
|
|
|
const customerDataWithTimestamp = docs.map((doc, index) => ({
|
|
|
|
|
|
|
|
data: doc,
|
|
|
|
|
|
|
|
timestamp: timestamps[index]
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
//reply.send({ status_code: 200, data: docs, count: docs.length ,timestamps});
|
|
|
|
|
|
|
|
reply.send({ status_code: 200, data: customerDataWithTimestamp, count: docs.length });
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
.catch((err) => {
|
|
|
|
console.log(err);
|
|
|
|
console.log(err);
|
|
|
|