✨ 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:
parent
deb7d05b98
commit
113b0fb4b7
6 changed files with 135 additions and 17 deletions
20
frontend/src/api/postBugData.ts
Normal file
20
frontend/src/api/postBugData.ts
Normal 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;
|
||||
};
|
||||
Reference in a new issue