Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun-Ganesh07 committed Jun 3, 2022
2 parents 8348205 + 2e6f936 commit fb9ef64
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
os: [ubuntu-latest] # macos-latest, windows-latest
node-version: [16.x]
#See supported Node.js release schedule at https://nodejs.org/en/about/releases/
#


steps:
- uses: actions/checkout@v2
Expand All @@ -29,7 +29,6 @@ jobs:
- run: npm test
- uses: akhileshns/[email protected]
with:

heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "dog-grooming-api"
heroku_email: "[email protected]"
3 changes: 2 additions & 1 deletion API-Modules/Controllers/User-Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ function generateAccessToken(email) {

async function signUp(req, res) {
if (!req.body.email || !req.body.password) {
console.log("fail 1");
//Missing password or Missing Email
res.status(400).send("Bad request: Missing field.");
} else {
//Has password and email
if (userServices.getUserByEmail(req.body.email)) {
if (await userServices.getUserByEmail(req.body.email)) {
//Email has already been used
res.status(409).send("Email already taken.");
} else {
Expand Down
1 change: 1 addition & 0 deletions DB-Modules/Services/user-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ async function getUserByEmail(email) {
}

async function addUser(user) {
console.log("From add user" + user);
dbC = dbConnection.getDbConnection(dbC);
const userModel = dbC.model("User", UserSchema);
// generate salt to hash password
Expand Down

0 comments on commit fb9ef64

Please sign in to comment.