Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jay Mehta
/
zango-strapi
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 e4d313e5
authored
2024-06-27 15:36:08 +0530
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
.
1 parent
d3892d59
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
src/api/vendor/controllers/vendor.js
src/api/vendor/controllers/vendor.js
View file @
e4d313e
...
...
@@ -40,7 +40,7 @@ module.exports = createCoreController("api::vendor.vendor", () => ({
},
});
// Check if its already existing in vendor entity
console
.
log
(
"
currentUser"
,
currentUser
);
console
.
log
(
"
here ctx.request.body"
,
ctx
.
request
.
body
);
console
.
log
(
"phoneNumber"
,
ctx
.
request
.
body
.
data
.
mobileNo
,
...
...
@@ -79,8 +79,11 @@ module.exports = createCoreController("api::vendor.vendor", () => ({
console
.
log
(
"ctx.request.body.data"
,
ctx
.
request
.
body
.
data
);
console
.
log
(
"existingUser"
,
existingUser
);
if
(
existingUser
)
{
if
(
existingUser
&&
existingUser
.
length
!==
0
)
{
console
.
log
(
"should be here"
);
}
else
{
console
.
log
(
"but is here"
);
ctx
.
request
.
body
.
data
.
user
=
currentUser
.
id
;
const
response
=
await
strapi
.
entityService
.
create
(
"api::vendor.vendor"
,
{
data
:
{
...
...
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