Commit b8abe8e6 by jay

.

1 parent 4d744d79
......@@ -13,9 +13,9 @@ module.exports = createCoreController("api::referral.referral", () => ({
const spertoRefereeData = await strapi
.service("api::referral.referral")
.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})
// console.log("spertoReferralData", spertoReferralData)
console.log("spertoReferralData", spertoReferralData)
ctx.request.body.data.httpRequestHeaders = JSON.stringify(
spertoRefereeData.headers
);
......
......@@ -12,17 +12,17 @@ module.exports = createCoreService(
"api::referral.referral",
({ strapi: Strapi }) => ({
async sendReferral(data) {
console.log(data);
console.log("data 1",data);
const headers = { "Content-Type": "application/json" };
const referralData = {
api_key: process.env.SPERTO_API_KEY,
campaign_key: process.env.CAMPAIGN_KEY,
member_type: "REFERRAL",
full_name: data.fullName,
full_name: data.referralName,
mobile1_isd: null,
mobile1: data.mobileNumber,
email1: data.email,
mobile1: data.referralMobileNo,
email1: data.referralEmail,
// building: data.building,
wing: data.wing,
unit_name: data.flatNumber ? data.flatNumber : "",
......@@ -60,7 +60,7 @@ module.exports = createCoreService(
},
async sendReferee(data) {
console.log(data);
console.log("data 2",data);
const headers = { "Content-Type": "application/json" };
const refereelData = {
api_key: process.env.SPERTO_API_KEY,
......@@ -68,7 +68,7 @@ module.exports = createCoreService(
member_type: "REFEREE",
full_name: data.fullName,
mobile1_isd: null,
mobile1: data.mobileNumber,
mobile1: data.mobileNo,
email1: data.email,
// building: data.building,
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!