Skip to content

Commit

Permalink
change type handling in SearchResultList
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredgrip committed Jan 8, 2025
1 parent 5f1af75 commit 7568eb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/lib/components/search/DocumentSearchResult.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
} from "$lib/search/searchTypes";
export let document:
| (GoverningDocumentSearchReturnAttributes & { type: "gov" })
| (MeetingDocumentSearchReturnAttributes & { type: "meeting" });
| (GoverningDocumentSearchReturnAttributes & { type: "governingDocuments" })
| (MeetingDocumentSearchReturnAttributes & { type: "meetingDocuments" });
const getUrl = (url: string) => {
if (url.startsWith("http")) {
Expand All @@ -26,7 +26,7 @@
class="search-result border border-transparent focus:border-primary"
>
<div class="avatar aspect-square w-8 overflow-hidden rounded-full">
{#if document.type === "gov"}
{#if document.type === "governingDocuments"}
<span class="i-mdi-gavel text-2xl"></span>
{:else}
<span class="i-mdi-text-box-multiple-outline text-2xl"></span>
Expand Down
8 changes: 6 additions & 2 deletions src/lib/components/search/SearchResultList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@
{:else if searchValue.type === "committees"}
<CommitteeSearchResult committee={searchValue.data} />
{:else if searchValue.type === "governingDocuments"}
<DocumentSearchResult document={{ ...searchValue.data, type: "gov" }} />
<DocumentSearchResult
document={{ ...searchValue.data, type: searchValue.type }}
/>
{:else if searchValue.type === "meetingDocuments"}
<DocumentSearchResult document={{ ...searchValue.data, type: "meeting" }} />
<DocumentSearchResult
document={{ ...searchValue.data, type: searchValue.type }}
/>
{/if}
{/each}

0 comments on commit 7568eb0

Please sign in to comment.