Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix reject liinks #272

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions controllers/campaign.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2447,16 +2447,19 @@ module.exports.campaignInvested = async (req, res) => {
//REJECT influencer link controller by advertiser
exports.rejectLink = async (req, res) => {
const { lang = 'en', title = '', idCampaign, reason, email, link } = req.body;
const { idLink } = req.params;
const idUser = '0' + req.user._id;


const campaign = await fetchCampaign({_id: idCampaign});
const idUser = '0' +req.user._id;
const idLink = req.params.id

configureTranslation(lang)
let reqReason = reason.map(str => str)

const campaign = await fetchCampaign({_id:campaignId});


try {
if (idUser !== campaign?.idNode) {

return responseHandler.makeResponseError(res, 401, 'unauthorized');
}

Expand All @@ -2472,6 +2475,7 @@ exports.rejectLink = async (req, res) => {
{ returnOriginal: false }
)
let id = +req.body.idUser

const notificationPromise = notificationManager(id, 'cmp_candidate_reject_link', {
cmp_name: title,
action: 'link_rejected',
Expand Down