Skip to content

Commit

Permalink
fix(docs): test form action url
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliendossantos committed Mar 13, 2024
1 parent f5a3e8e commit 4a0e0a9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/playground/FindWorkForm.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>
<label for="source">source</label>
<select
id="sourceSelector"
id="typeSelector"
name="type"
class="dark:bg-black col-span-2 p-2 border dark:border-neutral-700 border-neutral-300 rounded-md dark:text-neutral-400 font-semibold"
>
Expand Down Expand Up @@ -44,14 +44,14 @@

<script>
const workForm = document.getElementById("findWorkForm") as HTMLFormElement
const sourceSelector = document.getElementById(
"sourceSelector"
const typeSelector = document.getElementById(
"typeSelector"
) as HTMLSelectElement

const path = { IGDB: "games", TMDB: "movies" }
const path = { VideoGame: "games", Movie: "movies" }

sourceSelector.addEventListener("change", function () {
const value = this.value as "IGDB" | "TMDB"
typeSelector.addEventListener("change", function () {
const value = this.value as "VideoGame" | "Movie"
workForm.action = `/${path[value]}/find`
})
</script>

0 comments on commit 4a0e0a9

Please sign in to comment.