Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Union Cooperatives
Farmers Cooperative
Commits
b9bde2f5
Commit
b9bde2f5
authored
Jul 21, 2019
by
varsha
Browse files
Update index.js
parent
d0d26139
Pipeline
#31724
passed with stage
in 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
routes/index.js
View file @
b9bde2f5
...
...
@@ -103,16 +103,28 @@ router.post('/customer_registration', function (req, res, next) {
Email
:
email
,
Password
:
password
}
Farmer
.
create
(
newlist
,
function
(
err
,
newone
){
Customer
.
findOne
({
username
:
req
.
body
.
uname
},
function
(
err
,
uname
)
// checked where the entered username is already in customers list
{
if
(
uname
)
{
res
.
send
(
'
A customer is already having this username please enter another username
'
);
}
else
{
Customer
.
create
(
newlist
,
function
(
err
,
newlyCreated
)
{
if
(
err
)
{
console
.
log
(
err
);
console
.
log
(
err
);
}
else
{
res
.
redirect
(
"
/
"
);
}
});
}
});
});
module
.
exports
=
router
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment