Fix incorrect retrieval of event ID
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { page } from '$app/state';
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
@@ -7,7 +8,8 @@
|
||||
let loading = $state(true);
|
||||
|
||||
onMount(async () => {
|
||||
const event_id = new URLSearchParams(window.location.search).get('id');
|
||||
const event_id = page.url.searchParams.get('id');
|
||||
|
||||
if (!event_id) {
|
||||
loading = false;
|
||||
return;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
let isAddingParticipants = $state(false);
|
||||
|
||||
onMount(async () => {
|
||||
const eventId = page.url.searchParams.get('id');
|
||||
const eventId = page.url.searchParams.get('eventId');
|
||||
if (eventId) {
|
||||
existingEventId = eventId;
|
||||
isAddingParticipants = true;
|
||||
@@ -74,11 +74,13 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="mt-2 mb-4">
|
||||
{#if isAddingParticipants}
|
||||
<h1 class="text-xl font-semibold text-gray-700 text-center">Add Participants to "{event.name}"</h1>
|
||||
{/if}
|
||||
</div>
|
||||
{#if isAddingParticipants}
|
||||
<div class="mt-2 mb-4">
|
||||
<h1 class="text-center text-xl font-semibold text-gray-700">
|
||||
Adding Participants to "{event.name}"
|
||||
</h1>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if step == 0}
|
||||
<StepConnectGoogle bind:authorized />
|
||||
@@ -103,27 +105,27 @@
|
||||
<div class="pb-20"></div>
|
||||
|
||||
<div
|
||||
class="fixed bottom-0 left-0 z-10 flex w-full items-center justify-between gap-4 border-t border-gray-300 bg-white px-4 py-2"
|
||||
style="max-width: 100vw;"
|
||||
class="fixed bottom-0 left-0 z-10 flex w-full items-center justify-between gap-4 border-t border-gray-300 bg-white px-4 py-2"
|
||||
style="max-width: 100vw;"
|
||||
>
|
||||
<div class="container mx-auto max-w-2xl p-2 flex justify-content-center">
|
||||
<button
|
||||
onclick={prevStep}
|
||||
disabled={step === 0}
|
||||
class="min-w-[100px] rounded-md border border-gray-300 bg-white px-4 py-2 text-gray-700 transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
aria-label="Previous step"
|
||||
>
|
||||
Previous
|
||||
</button>
|
||||
<span class="flex-1 flex items-center justify-center text-center font-medium text-gray-600">
|
||||
Step {step + 1} of {steps.length}
|
||||
</span>
|
||||
<button
|
||||
onclick={nextStep}
|
||||
disabled={step === steps.length - 1 || !stepConditions[step]}
|
||||
class="min-w-[100px] rounded border border-gray-300 bg-white px-4 py-2 text-gray-700 transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
>
|
||||
Next
|
||||
</button>
|
||||
</div>
|
||||
<div class="justify-content-center container mx-auto flex max-w-2xl p-2">
|
||||
<button
|
||||
onclick={prevStep}
|
||||
disabled={step === 0}
|
||||
class="min-w-[100px] rounded-md border border-gray-300 bg-white px-4 py-2 text-gray-700 transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
aria-label="Previous step"
|
||||
>
|
||||
Previous
|
||||
</button>
|
||||
<span class="flex flex-1 items-center justify-center text-center font-medium text-gray-600">
|
||||
Step {step + 1} of {steps.length}
|
||||
</span>
|
||||
<button
|
||||
onclick={nextStep}
|
||||
disabled={step === steps.length - 1 || !stepConditions[step]}
|
||||
class="min-w-[100px] rounded border border-gray-300 bg-white px-4 py-2 text-gray-700 transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
>
|
||||
Next
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user