-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into Tim_add_materials_list_routing
- Loading branch information
Showing
14 changed files
with
431 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const UserProfile = require('../models/userProfile'); | ||
|
||
const isEmailExistsController = function () { | ||
|
||
const isEmailExists = async function (req, res) { | ||
|
||
try { | ||
const userProfile = await UserProfile.findOne({ email: req.params.email }).lean().exec() | ||
|
||
if (userProfile) { | ||
res.status(200).send(`Email, ${userProfile.email}, found.`) | ||
} else { | ||
res.status(403).send(`Email, ${req.params.email}, not found.`) | ||
} | ||
} catch (err) { | ||
console.log(err) | ||
} | ||
} | ||
|
||
return { | ||
isEmailExists | ||
} | ||
} | ||
|
||
module.exports = isEmailExistsController |
Oops, something went wrong.