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
Hide 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", () => ({
...
@@ -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
);
);
...
...
src/api/referral/services/referral.js
View file @
b8abe8e
...
@@ -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
.
ful
lName
,
full_name
:
data
.
referra
lName
,
mobile1_isd
:
null
,
mobile1_isd
:
null
,
mobile1
:
data
.
mobileNumber
,
mobile1
:
data
.
referralMobileNo
,
email1
:
data
.
e
mail
,
email1
:
data
.
referralE
mail
,
// 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
.
mobileN
umber
,
mobile1
:
data
.
mobileN
o
,
email1
:
data
.
email
,
email1
:
data
.
email
,
// building: data.building,
// building: data.building,
wing
:
data
.
wing
,
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