mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-16 18:28:47 +00:00
Fixing 'firebase deploy' errors and warnings
This commit is contained in:
parent
5176f0250c
commit
90442fe3cd
@ -17,11 +17,11 @@ exports.putPost = (req, res) => {
|
|||||||
.then((doc) => {
|
.then((doc) => {
|
||||||
const resPost = newPost;
|
const resPost = newPost;
|
||||||
resPost.postId = doc.id;
|
resPost.postId = doc.id;
|
||||||
res.json(resPost);
|
return res.status(200).json(resPost);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
res.status(500).json({ error: 'something is wrong'});
|
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
return res.status(500).json({ error: 'something is wrong'});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,10 @@ exports.getProfileInfo = (req, res) => {
|
|||||||
db.collection('users').doc(req.user.handle).get()
|
db.collection('users').doc(req.user.handle).get()
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
return res.status(200).json(data.data());
|
return res.status(200).json(data.data());
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
return res.status(500).json(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -41,7 +45,7 @@ exports.updateProfileInfo = (req, res) => {
|
|||||||
|
|
||||||
exports.getUserDetails = (req, res) => {
|
exports.getUserDetails = (req, res) => {
|
||||||
let userData = {};
|
let userData = {};
|
||||||
db.doc('/users/${req.params.handle}').get().then((doc) => {
|
db.doc(`/users/${req.params.handle}`).get().then((doc) => {
|
||||||
if (doc.exists) {
|
if (doc.exists) {
|
||||||
userData.user = doc.data();
|
userData.user = doc.data();
|
||||||
return db.collection('post').where('userHandle', '==', req.params.handle)
|
return db.collection('post').where('userHandle', '==', req.params.handle)
|
||||||
|
|||||||
@ -4,7 +4,7 @@ const isEmpty = (str) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isEmail = (str) => {
|
const isEmail = (str) => {
|
||||||
const emailRegEx = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
const emailRegEx = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||||
if (str.match(emailRegEx)) return true;
|
if (str.match(emailRegEx)) return true;
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user