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 2cf9b731
authored
2023-02-22 12:00:57 +0530
by
jay
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
.
1 parent
5a81b9d5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
10 deletions
src/api/channel-partner/controllers/channel-partner.js
src/api/channel-partner/services/channel-partner.js
src/extensions/users-permissions/content-types/user/schema.json
src/extensions/users-permissions/strapi-server.js
src/api/channel-partner/controllers/channel-partner.js
View file @
2cf9b73
...
@@ -31,10 +31,11 @@ module.exports = createCoreController(
...
@@ -31,10 +31,11 @@ module.exports = createCoreController(
);
);
}
}
try
{
try
{
console
.
log
(
"Helllo >>>>>>>>"
,
ctx
.
request
.
body
.
data
);
const
spertoRegisterCP
=
await
strapi
const
spertoRegisterCP
=
await
strapi
.
service
(
"api::channel-partner.channel-partner"
)
.
service
(
"api::channel-partner.channel-partner"
)
.
sendCPToSperto
(
ctx
.
request
.
body
.
data
);
.
sendCPToSperto
(
ctx
.
request
.
body
.
data
);
console
.
log
(
"Helllo >>>>>>>>"
,
spertoRegisterCP
);
ctx
.
request
.
body
.
data
.
httpRegisterCPRequestHeaders
=
JSON
.
stringify
(
ctx
.
request
.
body
.
data
.
httpRegisterCPRequestHeaders
=
JSON
.
stringify
(
spertoRegisterCP
.
headers
spertoRegisterCP
.
headers
);
);
...
...
src/api/channel-partner/services/channel-partner.js
View file @
2cf9b73
...
@@ -18,7 +18,7 @@ module.exports = createCoreService(
...
@@ -18,7 +18,7 @@ module.exports = createCoreService(
const
cpData
=
{
const
cpData
=
{
api_key
:
process
.
env
.
SPERTO_API_KEY
,
api_key
:
process
.
env
.
SPERTO_API_KEY
,
name
:
data
.
contactPersonName
,
name
:
data
.
contactPersonName
,
firm_type
:
data
.
firm_t
ype
,
// --
firm_type
:
data
.
companyT
ype
,
// --
address
:
data
.
communicationAddress
,
address
:
data
.
communicationAddress
,
mobile_number
:
data
.
mobileNo
,
mobile_number
:
data
.
mobileNo
,
email
:
data
.
email
,
email
:
data
.
email
,
...
@@ -29,7 +29,7 @@ module.exports = createCoreService(
...
@@ -29,7 +29,7 @@ module.exports = createCoreService(
pancard
:
data
.
pan
,
pancard
:
data
.
pan
,
member_of
:
data
.
memberOf
,
member_of
:
data
.
memberOf
,
// scanned_cancelled_cheque_url: data.
// scanned_cancelled_cheque_url: data.
//
scanned_pan_url: data.panFile,
scanned_pan_url
:
data
.
panFile
,
// rera_certificate_url:
// rera_certificate_url:
firm_name
:
data
.
companyName
,
firm_name
:
data
.
companyName
,
sourcing_manager_id
:
Number
(
data
.
sourcingManager
),
sourcing_manager_id
:
Number
(
data
.
sourcingManager
),
...
...
src/extensions/users-permissions/content-types/user/schema.json
View file @
2cf9b73
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
},
},
"confirmed"
:
{
"confirmed"
:
{
"type"
:
"boolean"
,
"type"
:
"boolean"
,
"default"
:
fals
e
,
"default"
:
tru
e
,
"configurable"
:
false
"configurable"
:
false
},
},
"blocked"
:
{
"blocked"
:
{
...
...
src/extensions/users-permissions/strapi-server.js
View file @
2cf9b73
...
@@ -573,9 +573,9 @@ const userPermissionExtension = (plugin) => {
...
@@ -573,9 +573,9 @@ const userPermissionExtension = (plugin) => {
where
:
{
...
identifierFilter
,
provider
},
where
:
{
...
identifierFilter
,
provider
},
});
});
if
(
conflictingUserCount
>
0
)
{
//
if (conflictingUserCount > 0) {
throw
new
ApplicationError
(
"Email or Username are already taken"
);
//
throw new ApplicationError("Email or Username are already taken");
}
//
}
if
(
settings
.
unique_email
)
{
if
(
settings
.
unique_email
)
{
const
conflictingUserCount
=
await
strapi
const
conflictingUserCount
=
await
strapi
...
@@ -584,9 +584,9 @@ const userPermissionExtension = (plugin) => {
...
@@ -584,9 +584,9 @@ const userPermissionExtension = (plugin) => {
where
:
{
...
identifierFilter
},
where
:
{
...
identifierFilter
},
});
});
if
(
conflictingUserCount
>
0
)
{
//
if (conflictingUserCount > 0) {
throw
new
ApplicationError
(
"Email or Username are already taken"
);
//
throw new ApplicationError("Email or Username are already taken");
}
//
}
}
}
let
newUser
=
{
let
newUser
=
{
...
...
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