reportbug is "finished"

just need to update database!

Co-authored-by: haraldnilsen <harald_998@hotmail.com>
Signed-off-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
Sindre Kjelsrud 2024-01-10 13:05:58 +01:00
parent deb7d05b98
commit 113b0fb4b7
Signed by: sidski
GPG key ID: D2BBDF3EDE6BA9A6
6 changed files with 135 additions and 17 deletions

View file

@ -0,0 +1,20 @@
export const postBugData = (bugText: string) => {
let url = "http://localhost:8080/submitbug";
const response = fetch(url, {
method: "POST",
body: JSON.stringify({
bugText: bugText,
}),
})
.then((response) => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.ok;
})
.catch((error) => {
console.log(error);
});
return response;
};