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 c04799e1
authored
2023-02-03 16:04:21 +0530
by
jay
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
.
1 parent
1a8a62c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
src/api/lead/controllers/lead.js
src/api/lead/services/lead.js
src/api/lead/controllers/lead.js
View file @
c04799e
...
...
@@ -10,13 +10,13 @@ module.exports = createCoreController("api::lead.lead", () => ({
async
sendLeads
(
ctx
)
{},
async
create
(
ctx
)
{
console
.
log
(
">>>>"
,
ctx
);
//
console.log(">>>>", ctx);
try
{
const
spretoLeadData
=
await
strapi
.
service
(
"api::lead.lead"
)
.
sendLeadToSperto
(
ctx
.
request
.
body
.
data
);
console
.
log
(
"spretoLeadData"
,
spretoLeadData
);
//
console.log("spretoLeadData", spretoLeadData);
ctx
.
request
.
body
.
data
.
httpRequestHeaders
=
JSON
.
stringify
(
spretoLeadData
.
headers
);
...
...
src/api/lead/services/lead.js
View file @
c04799e
...
...
@@ -23,7 +23,8 @@ module.exports = createCoreService("api::lead.lead", ({ strapi: Strapi }) => ({
otp_verified_yn
:
"N"
,
page_url
:
data
.
UTMLink
?
data
.
UTMLink
:
""
,
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
)
{
leadData
.
comments
=
data
.
comments
;
...
...
@@ -52,7 +53,7 @@ module.exports = createCoreService("api::lead.lead", ({ strapi: Strapi }) => ({
leadData
,
{
headers
:
headers
}
);
console
.
log
(
"spertoResponse"
,
spertoResponse
);
//
console.log("spertoResponse",spertoResponse);
return
spertoResponse
;
},
}));
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