|
|
|
@ -556,13 +556,13 @@ exports.connectionStatus = async (req, reply) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.connectstatus = async (req, reply) => {
|
|
|
|
|
try {
|
|
|
|
|
const customerId = req.params.customerId;
|
|
|
|
|
const supplierId = req.query.supplierId;
|
|
|
|
|
const receiverId = mongoose.Types.ObjectId(supplierId);
|
|
|
|
|
const data = await FriendRequest.findOne({ sender: customerId, receiver: receiverId });
|
|
|
|
|
console.log(req.params.customerId)
|
|
|
|
|
console.log(req.query.supplierId)
|
|
|
|
|
const data = await FriendRequest.findOne({ customerId: customerId, supplierId: supplierId });
|
|
|
|
|
let connection_status = "not requested";
|
|
|
|
|
if (data) {
|
|
|
|
|
connection_status = data.status;
|
|
|
|
@ -572,3 +572,5 @@ exports.connectstatus = async (req, reply) => {
|
|
|
|
|
throw boom.boomify(err);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|