Skip to content

Commit

Permalink
fix tour dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Feb 11, 2025
1 parent b03ba56 commit d91e0ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/ui/TourDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,15 @@
<div>
{#if open!.tours && open.tours.length > 1}
{#each open.tours as tour, i}
{@const tourInfo = getTourInfoShort(tour)}
<Button
onclick={() => {
tourIndex = i;
}}
variant={tourIndex === i ? 'default' : 'outline'}
class="mx-2"
>
{getTourInfoShort(tour)}
{tourInfo.from} - {tourInfo.to}
</Button>
{/each}
{/if}
Expand Down Expand Up @@ -233,7 +234,7 @@
</Table.Cell>
<Table.Cell>{event.address}</Table.Cell>
<Table.Cell>
{event.customerName},
{event.customerName}
</Table.Cell>
<Table.Cell>
{event.customerPhone}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/util/getTourInfoShort.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { Tour } from '$lib/server/db/getTours';

export const getTourInfoShort = (tour: Tour) => {
console.log(tour.events[0].address);
console.log(tour.events[tour.events.length - 1].address);
return {
from: tour.events[0].address,
to: tour.events[tour.events.length - 1].address
Expand Down

0 comments on commit d91e0ee

Please sign in to comment.