mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-17 02:38:47 +00:00
getUserDetails is now working
This commit is contained in:
parent
570866ff40
commit
ac28b3e19e
@ -178,11 +178,11 @@ exports.updateProfileInfo = (req, res) => {
|
|||||||
|
|
||||||
exports.getUserDetails = (req, res) => {
|
exports.getUserDetails = (req, res) => {
|
||||||
let userData = {};
|
let userData = {};
|
||||||
db.doc(`/getUser/${req.params.handle}`)
|
db.doc(`/users/${req.body.handle}`)
|
||||||
.get()
|
.get()
|
||||||
.then((doc) => {
|
.then((doc) => {
|
||||||
if (doc.exists) {
|
if (doc.exists) {
|
||||||
userData.credentials = doc.data();
|
userData = doc.data();
|
||||||
return res.status(200).json({userData});
|
return res.status(200).json({userData});
|
||||||
} else {
|
} else {
|
||||||
return res.status(400).json({
|
return res.status(400).json({
|
||||||
|
|||||||
@ -27,7 +27,7 @@ app.post("/signup", signup);
|
|||||||
// and password
|
// and password
|
||||||
app.post("/login", login);
|
app.post("/login", login);
|
||||||
|
|
||||||
app.get("/getUser/:handle", fbAuth, getUserDetails);
|
app.get("/getUser", fbAuth, getUserDetails);
|
||||||
|
|
||||||
// Returns all profile data of the currently logged in user
|
// Returns all profile data of the currently logged in user
|
||||||
app.get("/getProfileInfo", fbAuth, getProfileInfo);
|
app.get("/getProfileInfo", fbAuth, getProfileInfo);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user