forked from React-Group/interstellar_ai
16 lines
470 B
TypeScript
16 lines
470 B
TypeScript
|
import axios from "axios";
|
||
|
|
||
|
const sendToDatabase = (data: any) => {
|
||
|
axios.post("http://localhost:5000/interstellar_ai/db", data)
|
||
|
.then(response => {
|
||
|
const status = response.data.status
|
||
|
console.log(status);
|
||
|
postMessage({ status })
|
||
|
console.log('message posted');
|
||
|
|
||
|
})
|
||
|
.catch(error => {
|
||
|
console.log("Error calling Database:", error)
|
||
|
postMessage({ status: 500 })
|
||
|
})
|
||
|
}
|