updated and added notification section
This commit is contained in:
parent
62a4e904df
commit
2d1e461510
@ -201,6 +201,16 @@ export const updateKycStatus = async (req, res) => {
|
||||
return res.status(403).json({ message: "Access denied" });
|
||||
}
|
||||
|
||||
if (status === "reject") {
|
||||
await rejectKYC(req.user._id, rejectionReason);
|
||||
await Notification.create({
|
||||
title: "KYC Rejected",
|
||||
msg: rejectionReason,
|
||||
kyc_ref: kyc._id,
|
||||
added_for: req.user._id,
|
||||
userType: req.userType,
|
||||
});
|
||||
}
|
||||
// Update the status
|
||||
if (status) {
|
||||
kyc.status = status;
|
||||
@ -209,7 +219,7 @@ export const updateKycStatus = async (req, res) => {
|
||||
// Add rejection reason to notes if status is reject
|
||||
if (kyc.status === "reject" || status === "reject") {
|
||||
// kyc.rejection_reason = rejectionReason;
|
||||
await rejectKYC(req.user._id, rejectionReason);
|
||||
|
||||
kyc.notes.push({
|
||||
message: rejectionReason,
|
||||
user: user,
|
||||
|
Loading…
Reference in New Issue
Block a user