mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-15 18:08:46 +00:00
Fix post topics being added to followed topics list
This commit is contained in:
parent
4f2e07756d
commit
e7afac9a19
@ -84,23 +84,23 @@ class Writing_Microblogs extends Component {
|
||||
console.error(err);
|
||||
});
|
||||
console.log(postData.microBlogTopics);
|
||||
let topicPromises = [];
|
||||
postData.microBlogTopics.forEach(topic => {
|
||||
topicPromises.push(axios
|
||||
.post("/putTopic", {
|
||||
following: topic
|
||||
})
|
||||
.then(res => {
|
||||
console.log(res.data);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
})
|
||||
)
|
||||
});
|
||||
// let topicPromises = [];
|
||||
// postData.microBlogTopics.forEach(topic => {
|
||||
// topicPromises.push(axios
|
||||
// .post("/putTopic", {
|
||||
// following: topic
|
||||
// })
|
||||
// .then(res => {
|
||||
// console.log(res.data);
|
||||
// })
|
||||
// .catch(err => {
|
||||
// console.error(err);
|
||||
// })
|
||||
// )
|
||||
// });
|
||||
event.preventDefault();
|
||||
topicPromises.push(postPromise);
|
||||
Promise.all(topicPromises)
|
||||
// topicPromises.push(postPromise);
|
||||
Promise.all([postPromise])
|
||||
.then(() => {
|
||||
this.setState({
|
||||
value: "",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user