refactor: resolve() internal links instead of plain hrefs
Type-checks every link against the real route tree. Caught a dead one: the
book page linked tags to /tag/{id}, a route that has never existed.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { resolve } from '$app/paths';
|
||||
import * as Table from '$lib/components/ui/table/index.js';
|
||||
import * as Card from '$lib/components/ui/card/index.js';
|
||||
import { getLibraryState } from '$lib/state/library.svelte';
|
||||
@@ -36,7 +37,10 @@
|
||||
>{library.name[0]}</Table.Cell
|
||||
>
|
||||
<Table.Cell class="font-medium">
|
||||
<a href={`/library/${library.id}`} class="hover:underline">{library.name}</a>
|
||||
<a
|
||||
href={resolve('/(root)/(library)/library/[libraryId]', { libraryId: String(library.id) })}
|
||||
class="hover:underline">{library.name}</a
|
||||
>
|
||||
</Table.Cell>
|
||||
<Table.Cell class="w-16 text-center">
|
||||
<EllipsisVertical class="scale-75" />
|
||||
|
||||
Reference in New Issue
Block a user