Commit b8abe8e6 by jay

.

1 parent 4d744d79
...@@ -13,9 +13,9 @@ module.exports = createCoreController("api::referral.referral", () => ({ ...@@ -13,9 +13,9 @@ module.exports = createCoreController("api::referral.referral", () => ({
const spertoRefereeData = await strapi const spertoRefereeData = await strapi
.service("api::referral.referral") .service("api::referral.referral")
.sendReferee(ctx.request.body.data); .sendReferee(ctx.request.body.data);
// console.log("spertoRefereeData", spertoRefereeData.data.member_id); console.log("spertoRefereeData", spertoRefereeData);
const spertoReferralData = await strapi.service("api::referral.referral").sendReferral({...ctx.request.body.data, parent_id: spertoRefereeData.data.member_id}) const spertoReferralData = await strapi.service("api::referral.referral").sendReferral({...ctx.request.body.data, parent_id: spertoRefereeData.data.member_id})
// console.log("spertoReferralData", spertoReferralData) console.log("spertoReferralData", spertoReferralData)
ctx.request.body.data.httpRequestHeaders = JSON.stringify( ctx.request.body.data.httpRequestHeaders = JSON.stringify(
spertoRefereeData.headers spertoRefereeData.headers
); );
......
...@@ -12,17 +12,17 @@ module.exports = createCoreService( ...@@ -12,17 +12,17 @@ module.exports = createCoreService(
"api::referral.referral", "api::referral.referral",
({ strapi: Strapi }) => ({ ({ strapi: Strapi }) => ({
async sendReferral(data) { async sendReferral(data) {
console.log(data); console.log("data 1",data);
const headers = { "Content-Type": "application/json" }; const headers = { "Content-Type": "application/json" };
const referralData = { const referralData = {
api_key: process.env.SPERTO_API_KEY, api_key: process.env.SPERTO_API_KEY,
campaign_key: process.env.CAMPAIGN_KEY, campaign_key: process.env.CAMPAIGN_KEY,
member_type: "REFERRAL", member_type: "REFERRAL",
full_name: data.fullName, full_name: data.referralName,
mobile1_isd: null, mobile1_isd: null,
mobile1: data.mobileNumber, mobile1: data.referralMobileNo,
email1: data.email, email1: data.referralEmail,
// building: data.building, // building: data.building,
wing: data.wing, wing: data.wing,
unit_name: data.flatNumber ? data.flatNumber : "", unit_name: data.flatNumber ? data.flatNumber : "",
...@@ -60,7 +60,7 @@ module.exports = createCoreService( ...@@ -60,7 +60,7 @@ module.exports = createCoreService(
}, },
async sendReferee(data) { async sendReferee(data) {
console.log(data); console.log("data 2",data);
const headers = { "Content-Type": "application/json" }; const headers = { "Content-Type": "application/json" };
const refereelData = { const refereelData = {
api_key: process.env.SPERTO_API_KEY, api_key: process.env.SPERTO_API_KEY,
...@@ -68,7 +68,7 @@ module.exports = createCoreService( ...@@ -68,7 +68,7 @@ module.exports = createCoreService(
member_type: "REFEREE", member_type: "REFEREE",
full_name: data.fullName, full_name: data.fullName,
mobile1_isd: null, mobile1_isd: null,
mobile1: data.mobileNumber, mobile1: data.mobileNo,
email1: data.email, email1: data.email,
// building: data.building, // building: data.building,
wing: data.wing, wing: data.wing,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!