mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-16 18:28:47 +00:00
Fix merge issues
This commit is contained in:
parent
7a0a5725b7
commit
77a3ba9f69
@ -238,7 +238,8 @@ exports.quoteWithoutPost = (req, res) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
return res.status(500).json({ error: "Something is wrong" });
|
// return res.status(500).json({ error: "Something is wrong" });
|
||||||
|
return res.status(500).json({ error: err });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -259,7 +260,11 @@ exports.checkforLikePost = (req, res) => {
|
|||||||
result = true;
|
result = true;
|
||||||
return res.status(200).json(result);
|
return res.status(200).json(result);
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
return res.status(500).json({error: err});
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.likePost = (req, res) => {
|
exports.likePost = (req, res) => {
|
||||||
@ -303,7 +308,8 @@ exports.likePost = (req, res) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
return res.status(500).json({ error: "Something is wrong" });
|
// return res.status(500).json({ error: "Something is wrong" });
|
||||||
|
return res.status(500).json({ error: err });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -52,8 +52,6 @@ exports.signup = (req, res) => {
|
|||||||
return res.status(400).json(errors);
|
return res.status(400).json(errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
const noImg = 'no-img.png';
|
|
||||||
|
|
||||||
let token, userId;
|
let token, userId;
|
||||||
|
|
||||||
db.doc(`/users/${newUser.handle}`)
|
db.doc(`/users/${newUser.handle}`)
|
||||||
@ -79,7 +77,6 @@ exports.signup = (req, res) => {
|
|||||||
email: newUser.email,
|
email: newUser.email,
|
||||||
handle: newUser.handle,
|
handle: newUser.handle,
|
||||||
createdAt: newUser.createdAt,
|
createdAt: newUser.createdAt,
|
||||||
imageUrl: `https://firebasestorage.googleapis.com/v0/b/${config.storageBucket}/o/${noImg}?alt=media`,
|
|
||||||
userId,
|
userId,
|
||||||
followedTopics: [],
|
followedTopics: [],
|
||||||
imageUrl: defaultImageUrl,
|
imageUrl: defaultImageUrl,
|
||||||
|
|||||||
@ -43,5 +43,5 @@
|
|||||||
"last 1 safari version"
|
"last 1 safari version"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"proxy": "http://localhost:5001/twistter-e4649/us-central1/api"
|
"proxy": "https://us-central1-twistter-e4649.cloudfunctions.net/api"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import noImage from '../images/no-img.png';
|
|||||||
// Material-UI stuff
|
// Material-UI stuff
|
||||||
import Box from "@material-ui/core/Box"
|
import Box from "@material-ui/core/Box"
|
||||||
import Button from "@material-ui/core/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import Box from "@material-ui/core/Box";
|
|
||||||
import CircularProgress from "@material-ui/core/CircularProgress";
|
import CircularProgress from "@material-ui/core/CircularProgress";
|
||||||
import Grid from "@material-ui/core/Grid";
|
import Grid from "@material-ui/core/Grid";
|
||||||
import Popover from "@material-ui/core/Popover";
|
import Popover from "@material-ui/core/Popover";
|
||||||
@ -253,96 +252,6 @@ export class editProfile extends Component {
|
|||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
|
||||||
<Grid container className={classes.form}>
|
|
||||||
<Grid item sm />
|
|
||||||
<Grid item sm>
|
|
||||||
<Typography variant="h2" className={classes.pageTitle}>
|
|
||||||
Edit Profile
|
|
||||||
</Typography>
|
|
||||||
<form noValidate onSubmit={this.handleSubmit}>
|
|
||||||
{imageMarkup}
|
|
||||||
<input type="file" id="imageUpload" onChange={this.handleImageChange} hidden = "hidden"/>
|
|
||||||
<Tooltip title="Edit profile picture" placement="top">
|
|
||||||
<IconButton onClick={this.handleEditPicture} className="button">
|
|
||||||
<EditIcon color="primary"/>
|
|
||||||
</IconButton>
|
|
||||||
</Tooltip>
|
|
||||||
<Grid container className={classes.form} spacing={4}>
|
|
||||||
<Grid item sm>
|
|
||||||
<TextField
|
|
||||||
id="firstName"
|
|
||||||
name="firstName"
|
|
||||||
label="First Name"
|
|
||||||
className={classes.textField}
|
|
||||||
value={this.state.firstName}
|
|
||||||
helperText={errors.firstName}
|
|
||||||
error={errors.firstName ? true : false}
|
|
||||||
variant="outlined"
|
|
||||||
onChange={this.handleChange}
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item sm>
|
|
||||||
<TextField
|
|
||||||
id="lastName"
|
|
||||||
name="lastName"
|
|
||||||
label="Last Name"
|
|
||||||
className={classes.textField}
|
|
||||||
value={this.state.lastName}
|
|
||||||
helperText={errors.lastname}
|
|
||||||
error={errors.lastName ? true : false}
|
|
||||||
variant="outlined"
|
|
||||||
onChange={this.handleChange}
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
<TextField
|
|
||||||
id="email"
|
|
||||||
name="email"
|
|
||||||
label="Email*"
|
|
||||||
className={classes.textField}
|
|
||||||
value={this.state.email}
|
|
||||||
disabled
|
|
||||||
helperText="(disabled)"
|
|
||||||
// INFO: These will be uncommented if changing emails is allowed
|
|
||||||
// helperText={errors.email}
|
|
||||||
// error={errors.email ? true : false}
|
|
||||||
variant="outlined"
|
|
||||||
onChange={this.handleChange}
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
<TextField
|
|
||||||
id="handle"
|
|
||||||
name="handle"
|
|
||||||
label="Handle*"
|
|
||||||
className={classes.textField}
|
|
||||||
value={this.state.handle}
|
|
||||||
disabled
|
|
||||||
helperText="(disabled)"
|
|
||||||
// INFO: These will be uncommented if changing usernames is allowed
|
|
||||||
// helperText={errors.handle}
|
|
||||||
// error={errors.handle ? true : false}
|
|
||||||
variant="outlined"
|
|
||||||
onChange={this.handleChange}
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
<TextField
|
|
||||||
id="bio"
|
|
||||||
name="bio"
|
|
||||||
label="Bio"
|
|
||||||
className={classes.textField}
|
|
||||||
value={this.state.bio}
|
|
||||||
helperText={errors.bio}
|
|
||||||
error={errors.bio ? true : false}
|
|
||||||
multiline
|
|
||||||
rows="8"
|
|
||||||
variant="outlined"
|
|
||||||
onChange={this.handleChange}
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
// =======
|
|
||||||
// Used for the delete button
|
// Used for the delete button
|
||||||
const open = Boolean(this.state.anchorEl);
|
const open = Boolean(this.state.anchorEl);
|
||||||
const id = open ? 'simple-popover' : undefined;
|
const id = open ? 'simple-popover' : undefined;
|
||||||
@ -353,7 +262,6 @@ export class editProfile extends Component {
|
|||||||
:
|
:
|
||||||
<Grid container className={classes.form} id="container-grid">
|
<Grid container className={classes.form} id="container-grid">
|
||||||
<Grid item sm >
|
<Grid item sm >
|
||||||
// >>>>>>> master
|
|
||||||
<Button
|
<Button
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
color="primary"
|
color="primary"
|
||||||
@ -371,6 +279,12 @@ export class editProfile extends Component {
|
|||||||
Edit Profile
|
Edit Profile
|
||||||
</Typography>
|
</Typography>
|
||||||
<form noValidate onSubmit={this.handleSubmit}>
|
<form noValidate onSubmit={this.handleSubmit}>
|
||||||
|
{imageMarkup}
|
||||||
|
<input type="file" id="imageUpload" onChange={this.handleImageChange} hidden = "hidden"/>
|
||||||
|
<Tooltip title="Edit profile picture" placement="top">
|
||||||
|
<IconButton onClick={this.handleEditPicture} className="button">
|
||||||
|
<EditIcon color="primary"/>
|
||||||
|
</IconButton></Tooltip>
|
||||||
<Grid container className={classes.form} spacing={4}>
|
<Grid container className={classes.form} spacing={4}>
|
||||||
<Grid item sm>
|
<Grid item sm>
|
||||||
<TextField
|
<TextField
|
||||||
@ -547,10 +461,10 @@ const mapStateToProps = (state) => ({
|
|||||||
|
|
||||||
const mapActionsToProps = { uploadImage }
|
const mapActionsToProps = { uploadImage }
|
||||||
|
|
||||||
edit.propTypes = {
|
editProfile.propTypes = {
|
||||||
uploadImage: PropTypes.func.isRequired,
|
uploadImage: PropTypes.func.isRequired,
|
||||||
classes: PropTypes.object.isRequired
|
classes: PropTypes.object.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
// export default withStyles(styles)(edit);
|
// export default withStyles(styles)(edit);
|
||||||
export default connect(mapStateToProps, mapActionsToProps)(withStyles(styles)(edit));
|
export default connect(mapStateToProps, mapActionsToProps)(withStyles(styles)(editProfile));
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import {
|
|||||||
} from '../types';
|
} from '../types';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
|
// Saves Authorization in browser local storage and adds it as a header to axios
|
||||||
const setAuthorizationHeader = (token) => {
|
const setAuthorizationHeader = (token) => {
|
||||||
const FBIdToken = `Bearer ${token}`;
|
const FBIdToken = `Bearer ${token}`;
|
||||||
localStorage.setItem('FBIdToken', FBIdToken);
|
localStorage.setItem('FBIdToken', FBIdToken);
|
||||||
@ -101,13 +102,6 @@ export const deleteUser = () => (dispatch) => {
|
|||||||
dispatch({ type: SET_UNAUTHENTICATED });
|
dispatch({ type: SET_UNAUTHENTICATED });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Saves Authorization in browser local storage and adds it as a header to axios
|
|
||||||
const setAuthorizationHeader = (token) => {
|
|
||||||
const FBIdToken = `Bearer ${token}`;
|
|
||||||
localStorage.setItem('FBIdToken', FBIdToken);
|
|
||||||
axios.defaults.headers.common['Authorization'] = FBIdToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sends an image data form to firebase to be uploaded to the user profile
|
// Sends an image data form to firebase to be uploaded to the user profile
|
||||||
export const uploadImage = (formData) => (dispatch) => {
|
export const uploadImage = (formData) => (dispatch) => {
|
||||||
dispatch({ type: LOADING_UI });
|
dispatch({ type: LOADING_UI });
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user