RD map with TM,PD,SC
This commit is contained in:
parent
11848e7b6b
commit
d602fdc7be
@ -430,10 +430,10 @@ export const getAllRetailDistributorApproved = async (req, res) => {
|
||||
export const getRDId = async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
console.log(id);
|
||||
// console.log(id);
|
||||
// Fetch the KYC document from the database by ID
|
||||
const RD = await RetailDistributor.findById(id)
|
||||
.populate("principal_distributer", "name")
|
||||
.populate("principal_distributer", "name email phone")
|
||||
.populate("addedBy")
|
||||
.populate("kyc")
|
||||
.populate("mappedTM")
|
||||
@ -443,7 +443,7 @@ export const getRDId = async (req, res) => {
|
||||
if (!RD) {
|
||||
return res.status(404).json({ message: "No RetailDistributor found" });
|
||||
}
|
||||
|
||||
// console.log(RD);
|
||||
// Send the fetched KYC document as a response
|
||||
res.status(200).json(RD);
|
||||
} catch (error) {
|
||||
@ -1150,7 +1150,7 @@ export const updateRDMapped = async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const { principal_distributor, mappedTM, mappedSC } = req.body;
|
||||
console.log(principal_distributor);
|
||||
// console.log(principal_distributor);
|
||||
// Find the RetailDistributor document by ID
|
||||
const RD = await RetailDistributor.findById(id);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user