Skip to content

Commit eccbaa1

Browse files
committed
Pending request fix
1 parent 9581f7e commit eccbaa1

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/server/routes/mailchimp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ routes.get('/campaign-folders', (req, res) => new MailchimpService().getCampaign
2929

3030
routes.get('/campaigns', (req, res) => new MailchimpService().getCampaigns(req).then(res.send.bind(res)));
3131

32-
routes.post('/email', (req, res) => sendEmail(req, res));
32+
routes.post('/email', (req, res) => sendEmail(req, res).then(res.send.bind(res)));
3333

3434
export default routes;

src/server/services/sendGrid.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ sgMail.setApiKey(config.SECRET.SENDGRID_API_KEY);
1414
* @param {Object} req the request
1515
* @param {Object} res the response
1616
*/
17-
export function sendEmail(req, res) {
17+
export async function sendEmail(req, res) {
1818
const msg = req.body;
1919
return sgMail
2020
.send(msg)
21-
.then(result => res.send(result))
21+
.then(result => result)
2222
.catch((error) => {
2323
logger.error(error);
2424
const { message, code, response } = error;
2525
res.status(code || 500);
2626
if (error.response) {
2727
const { headers, body } = response;
28-
return res.send({
28+
return {
2929
message, headers, body,
30-
});
30+
};
3131
}
32-
return res.send({ message });
32+
return { message };
3333
});
3434
}
3535

src/shared/containers/Gigs/RecruitCRMJobDetails.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,20 @@ https://www.topcoder.com/gigs/${props.id}`,
103103
body: JSON.stringify({
104104
from: `${profile.firstName} ${profile.lastName} via Topcoder Gigwork <[email protected]>`,
105105
to: formData.email,
106+
replyTo: '[email protected]',
106107
subject: `${profile.firstName} ${profile.lastName} Thinks This Topcoder Gig Is For You!`,
107108
text: formData.body,
108109
}),
109110
headers: {
110111
'Content-Type': 'application/json',
111112
},
113+
redirect: 'follow',
112114
});
113115
if (res.status >= 300) {
114116
this.setState({
115117
isReferrError: await res.json(),
116118
});
117119
} else {
118-
await res.json();
119120
this.setState({
120121
isReferrSucess: true,
121122
});

0 commit comments

Comments
 (0)