Compare commits

...

2 Commits

Author SHA1 Message Date
Fred Boniface 50f07bb32c Add isLoading to issue page 2023-06-26 16:33:17 +01:00
Fred Boniface 2b1478f685 Update issue URL 2023-06-26 16:04:01 +01:00
1 changed files with 8 additions and 1 deletions

View File

@ -3,8 +3,10 @@
import Island from "$lib/islands/island.svelte"; import Island from "$lib/islands/island.svelte";
import Nav from "$lib/navigation/nav.svelte"; import Nav from "$lib/navigation/nav.svelte";
import { onMount } from "svelte"; import { onMount } from "svelte";
import Loading from "$lib/navigation/loading.svelte";
const title = "Report Issue"; const title = "Report Issue";
let isLoading = false;
let reportType = "", reportSubject = "", reportMsg = "", reportCollected let reportType = "", reportSubject = "", reportMsg = "", reportCollected
onMount(async () => { onMount(async () => {
@ -26,6 +28,7 @@
async function send() { async function send() {
console.log("SEND DATA REQUESTED") console.log("SEND DATA REQUESTED")
isLoading = true
const formData = JSON.stringify({ const formData = JSON.stringify({
labels: [reportType], labels: [reportType],
subject: reportSubject, subject: reportSubject,
@ -37,7 +40,7 @@
`User Message:\n` + `User Message:\n` +
`${reportMsg}` `${reportMsg}`
}) })
const url = `https://owlboard.info/api/v1/issue` const url = `https://owlboard.info/misc/issue`
const options = { const options = {
method: "POST", method: "POST",
body: formData body: formData
@ -53,6 +56,10 @@
</script> </script>
<Header {title} /> <Header {title} />
{#if isLoading}
<Loading />
{/if}
{#if !preFlight} {#if !preFlight}
<p>Any data that you enter here will be visible publicly <p>Any data that you enter here will be visible publicly
<a href="https://git.fjla.uk/OwlBoard/backend/issues" target="_blank">here</a> <a href="https://git.fjla.uk/OwlBoard/backend/issues" target="_blank">here</a>