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

@@ -337,13 +337,7 @@ const CardPaymentModalComponent = ({
message.success(t("general.actions.copied"));
}}
>
<div
onClick={() => {
//Copy the link.
}}
>
{paymentLink}
</div>
<div>{paymentLink}</div>
<CopyFilled />
</Space>
)}

View File

@@ -35,7 +35,7 @@ export function PaymentsGenerateLink({ bodyshop, currentUser, callback, job, ope
try {
p = parsePhoneNumber(job.ownr_ph1 || "", "CA");
} catch (error) {
console.log("Unable to part phone number");
console.log("Unable to parse phone number");
}
setLoading(true);
const response = await axios.post("/intellipay/generate_payment_url", {

View File

@@ -95,8 +95,8 @@ const formatPriority = (priority) => {
* @returns {{header, body: string, subHeader: string}}
*/
function getEndpoints() {
const endPoints = InstanceManager({
const getEndpoints = () =>
InstanceManager({
imex: process.env?.NODE_ENV === "test" ? "https://test.imex.online" : "https://imex.online",
rome:
bodyshop.convenient_company === "promanager"
@@ -107,8 +107,7 @@ function getEndpoints() {
? "https//test.romeonline.io"
: "https://romeonline.io"
});
return endPoints;
}
const generateTemplateArgs = (title, priority, description, dueDate, bodyshop, job, taskId) => {
const endPoints = getEndpoints();
return {

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.