IO-2933 Resolve PR comments.

This commit is contained in:
Patrick Fic
2024-09-18 11:19:43 -07:00
parent 2a33f462a3
commit e3059b41ae
4 changed files with 10 additions and 19 deletions

View File

@@ -172,12 +172,9 @@ exports.postback = async (req, res) => {
//Adding in the user email to the short pay email.
//Need to check this to ensure backwards compatibility for clients that don't update.
let partialPayments;
if (!Array.isArray(parsedComment)) {
partialPayments = parsedComment.payments;
} else {
partialPayments = parsedComment;
}
const partialPayments = Array.isArray(parsedComment) ? parsedComment : parsedComment.payments;
const jobs = await gqlClient.request(queries.GET_JOBS_BY_PKS, {
ids: partialPayments.map((p) => p.jobid)
});
@@ -207,7 +204,7 @@ exports.postback = async (req, res) => {
iprequest: values,
paymentResult
});
res.sendStatus(200);
if (values.origin === "OneLink" && parsedComment.userEmail) {
//Send an email, it was a text to pay link.
const endPoints = getEndpoints();
@@ -226,6 +223,7 @@ exports.postback = async (req, res) => {
.join("<br/>")
})
});
res.sendStatus(200);
}
} else if (values.invoice) {
//This is a link email that's been sent out.