fix: Miscellaneous improvements

This commit is contained in:
NunoSempere 2021-10-05 18:34:42 +02:00
parent 8d4bf5f56e
commit 946036077c
2 changed files with 10 additions and 0 deletions

8
lib/pushToMongo.js Normal file
View File

@ -0,0 +1,8 @@
import axios from "axios"
export async function pushToMongo(data){
let response = await axios.post('http://metaforecast-twitter-bot.herokuapp.com/utility-function-extractor', {
data: data
})
console.log(response)
}

View File

@ -8,6 +8,7 @@ import { DisplayElement } from '../lib/displayElement'
import { DisplayAsMarkdown } from '../lib/displayAsMarkdown'
import { CreateTableWithDistances } from '../lib/findPaths'
import { TextAreaForJson } from "../lib/textAreaForJson"
import { pushToMongo } from "../lib/pushToMongo"
let increasingList = (n) => Array.from(Array(n).keys())
let buildLinks = quantitativeComparisons => quantitativeComparisons.map(([element1, element2, distance]) => ({ source: element1, target: element2, distance: distance }))
@ -223,6 +224,7 @@ export default function Home({ listOfElementsDefault }) {
setSliderValue(0)
if (successStatus) {
let jsObject = nicelyFormatLinks(quantitativeComparisons, listOfElements)
pushToMongo(jsObject)
console.log(jsObject)
}
}