Fix post topics being added to followed topics list

This commit is contained in:
Clayton Wilson 2019-12-06 13:35:28 -05:00
parent 4f2e07756d
commit e7afac9a19

View File

@ -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: "",