mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-10 21:25:04 +00:00
completed search page and redirect to user profile page
This commit is contained in:
@@ -415,16 +415,15 @@ exports.unverifyUser = (req, res) => {
|
||||
});
|
||||
};
|
||||
exports.getUserHandles = (req, res) => {
|
||||
admin
|
||||
.firestore()
|
||||
.collection("users")
|
||||
db.doc(`/users/${req.body.userHandle}`)
|
||||
.get()
|
||||
.then(data => {
|
||||
let users = [];
|
||||
data.forEach(function(doc) {
|
||||
users.push(doc.data().handle);
|
||||
});
|
||||
return res.status(200).json(users);
|
||||
.then(doc => {
|
||||
if (doc.exists) {
|
||||
let userHandle = doc.data().handle;
|
||||
return res.status(200).json(userHandle);
|
||||
} else {
|
||||
return res.status(404).json({ error: "user not found" });
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
|
||||
Reference in New Issue
Block a user