aboutsummaryrefslogtreecommitdiff
path: root/web/pw-server/src/routes/index.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'web/pw-server/src/routes/index.svelte')
-rw-r--r--web/pw-server/src/routes/index.svelte11
1 files changed, 7 insertions, 4 deletions
diff --git a/web/pw-server/src/routes/index.svelte b/web/pw-server/src/routes/index.svelte
index 0e811b3..a2a2e61 100644
--- a/web/pw-server/src/routes/index.svelte
+++ b/web/pw-server/src/routes/index.svelte
@@ -1,4 +1,6 @@
<script lang="ts">
+ import { goto } from "$app/navigation";
+
let code = "";
async function submitCode() {
@@ -9,7 +11,7 @@
"Content-Type": "application/json",
},
body: JSON.stringify({
- "code": code,
+ code: code,
}),
});
@@ -17,11 +19,12 @@
throw Error(response.statusText);
}
- let responseData = await response.json()
- console.log(responseData);
+ let responseData = await response.json();
+ let matchId = responseData["match_id"];
+ goto(`/submission_matches/${matchId}`);
}
</script>
<h1>Planetwars</h1>
<textarea bind:value={code} />
-<button on:click={submitCode}>Submit</button> \ No newline at end of file
+<button on:click={submitCode}>Submit</button>