Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jay Mehta
/
strapi-setup-file
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit b8abe8e6
authored
2023-03-03 15:11:45 +0530
by
jay
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
.
1 parent
4d744d79
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
src/api/referral/controllers/referral.js
src/api/referral/services/referral.js
src/api/referral/controllers/referral.js
View file @
b8abe8e
...
...
@@ -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
);
...
...
src/api/referral/services/referral.js
View file @
b8abe8e
...
...
@@ -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
.
ful
lName
,
full_name
:
data
.
referra
lName
,
mobile1_isd
:
null
,
mobile1
:
data
.
mobileNumber
,
email1
:
data
.
e
mail
,
mobile1
:
data
.
referralMobileNo
,
email1
:
data
.
referralE
mail
,
// 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
.
mobileN
umber
,
mobile1
:
data
.
mobileN
o
,
email1
:
data
.
email
,
// building: data.building,
wing
:
data
.
wing
,
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment