Merge pull request 'main' (#41) from React-Group/interstellar_ai:main into main

Reviewed-on: https://interstellardevelopment.org/code/code/sageTheDm/interstellar_ai/pulls/41
This commit is contained in:
sageTheDm 2024-10-07 11:49:59 +02:00
commit bf29313276

View file

@ -19,7 +19,11 @@ to check if the request was accepted or declined, check response.data.response,
*/
const apiURL = new URL("http://localhost:5000/interstellar_ai/db")
if (typeof window !== 'undefined') {
apiURL.hostname = window.location.hostname;
} else {
apiURL.hostname = "localhost"
}
export const sendToDatabase = async (data: object): Promise<boolean> => {
try {