diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d42daa6..62a47e2 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -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 @@ -29,7 +29,6 @@ jobs: - run: npm test - uses: akhileshns/heroku-deploy@v3.12.12 with: - heroku_api_key: ${{secrets.HEROKU_API_KEY}} heroku_app_name: "dog-grooming-api" heroku_email: "arun.gan1234@gmail.com" diff --git a/API-Modules/Controllers/User-Controller.js b/API-Modules/Controllers/User-Controller.js index a259a7f..66a8c20 100644 --- a/API-Modules/Controllers/User-Controller.js +++ b/API-Modules/Controllers/User-Controller.js @@ -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 { diff --git a/DB-Modules/Services/user-services.js b/DB-Modules/Services/user-services.js index 2a6c46a..dde7d55 100644 --- a/DB-Modules/Services/user-services.js +++ b/DB-Modules/Services/user-services.js @@ -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