Commit c04799e1 by jay

.

1 parent 1a8a62c1
...@@ -10,13 +10,13 @@ module.exports = createCoreController("api::lead.lead", () => ({ ...@@ -10,13 +10,13 @@ module.exports = createCoreController("api::lead.lead", () => ({
async sendLeads(ctx) {}, async sendLeads(ctx) {},
async create(ctx) { async create(ctx) {
console.log(">>>>", ctx); // console.log(">>>>", ctx);
try { try {
const spretoLeadData = await strapi const spretoLeadData = await strapi
.service("api::lead.lead") .service("api::lead.lead")
.sendLeadToSperto(ctx.request.body.data); .sendLeadToSperto(ctx.request.body.data);
console.log("spretoLeadData", spretoLeadData); // console.log("spretoLeadData", spretoLeadData);
ctx.request.body.data.httpRequestHeaders = JSON.stringify( ctx.request.body.data.httpRequestHeaders = JSON.stringify(
spretoLeadData.headers spretoLeadData.headers
); );
......
...@@ -23,7 +23,8 @@ module.exports = createCoreService("api::lead.lead", ({ strapi: Strapi }) => ({ ...@@ -23,7 +23,8 @@ module.exports = createCoreService("api::lead.lead", ({ strapi: Strapi }) => ({
otp_verified_yn: "N", otp_verified_yn: "N",
page_url: data.UTMLink ? data.UTMLink : "", page_url: data.UTMLink ? data.UTMLink : "",
utm_medium: data.utm_medium ? data.utm_medium : "", utm_medium: data.utm_medium ? data.utm_medium : "",
utm_source: data.utm_source ? data.utm_source : "" utm_source: data.utm_source ? data.utm_source : "",
utm_campaign: data.utm_campaign ? data.utm_campaign : ""
}; };
if (data.comments) { if (data.comments) {
leadData.comments = data.comments; leadData.comments = data.comments;
...@@ -52,7 +53,7 @@ module.exports = createCoreService("api::lead.lead", ({ strapi: Strapi }) => ({ ...@@ -52,7 +53,7 @@ module.exports = createCoreService("api::lead.lead", ({ strapi: Strapi }) => ({
leadData, leadData,
{ headers: headers } { headers: headers }
); );
console.log("spertoResponse",spertoResponse); // console.log("spertoResponse",spertoResponse);
return spertoResponse; return spertoResponse;
}, },
})); }));
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!